我想用python selenium来雕刻追随者数字。例如,如何从下面的html中删除“108,381”以下的数字?请帮忙
<a class="-nal3 " href="/accounts/login/?next=%2Fj_wontagii%2Ffollowers%2F&source=followed_by_list">팔로워 <span class="g47SY " title="108,381">108천</span></a>
<span class="g47SY " title="108,381">108천</span>
请尝试以下选项。您必须使用title
属性来获取值。
driver.find_element_by_class_name("g47SY ").get_attribute("title")
要么
driver.find_element_by_css_selector("span.g47SY ").get_attribute("title")
要么
driver.find_element_by_xpath("//span[@class='g47SY ']").get_attribute("title")