简体   繁体   English

如何使用 python selenium 在 html 代码 [Instagram] 中创建一个值

[英]how to carve out a value in html code [Instagram] using python selenium

I'd like to carve out follower numbers using python selenium.我想使用 python selenium 计算出追随者人数。 For example, how can I carve out number below "108,381" from the html below?例如,如何从下面的 html 中雕刻出“108,381”以下的数字? Please help请帮忙

<a class="-nal3 " href="/accounts/login/?next=%2Fj_wontagii%2Ffollowers%2F&amp;source=followed_by_list">팔로워 <span class="g47SY " title="108,381">108천</span></a>

<span class="g47SY " title="108,381">108천</span>

Try the following options.You have to take the title attribute to get the value.尝试以下选项。您必须使用title属性来获取值。

driver.find_element_by_class_name("g47SY ").get_attribute("title")

OR或者

driver.find_element_by_css_selector("span.g47SY ").get_attribute("title")

OR或者

driver.find_element_by_xpath("//span[@class='g47SY ']").get_attribute("title")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Instagram 抓取:如何使用 selenium Python 获取 Instagram 个人资料名称 - Instagram scraping: How to get the Instagram Profile Name using selenium Python "如何使用 python 使用 selenium 在 instagram 中上传图像?" - How to upload an image in instagram using selenium using python? 我如何使用 selenium 在 python 中打印 instagram 回复消息 - how can i print instagram reply message in python using selenium 如何在 Python 中使用 Selenium 单击 Instagram 评论按钮 - How to click on the Instagram Comment button using Selenium in Python 如何避免每次使用 Selenium 和 Python 的 Instagram 登录页面 - How to avoid Instagram login page everytime using Selenium and Python 如何使用 Selenium 和 Python 在 Instagram 上找到取消关注按钮? - How do I find the unfollow button on Instagram using Selenium and Python? 如何使用 selenium 和 python 在 Instagram 通知中点击“不是现在” - how to click on "not now" in instagram notification using selenium and python 如何使用 python 和 selenium 将多个图像上传到 Instagram - How do I upload multiple images to Instagram using python with selenium 如何使用 selenium python 访问隐藏的 Instagram 按钮 - How to access hidden instagram button using selenium python 如何使用Python使用Selenium Webdriver获取此html中的一些文本值? - How to get the some text value in this html with Selenium Webdriver using Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM