I need to get all the text inside the <a>
tags, but I can get only the text of the first <a>
tag.
Here is my code:
table_page = driver2.find_elements_by_class_name('paging')
for tn in table_page:
num = tn.find_element_by_class_name('paper.page_link')
print(num.text)
and this is the HTML code:
<div class="paging">
<em class=" link_page" style="cursor:pointer"> 1 </em>
<a class="paper page_link" href="javascript:" url="./detail_nbid" page_num="2">2</a>
<a class="paper page_link" href="javascript:" url="./detail_nbid" page_num="3">3</a>
</div>
what I expected is 2, 3
but I get only 2
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…