【发布时间】:2021-07-24 16:07:43
【问题描述】:
我想将此部分打印到控制台。 (标记)Image
这是我最后一次尝试:
我在上次尝试时收到此错误:
无法定位元素:
{"method":"xpath","selector":"//*[@id="react-root"]/section/main/div/ul/li[2]/a/span"}
请保留我的此文本更改。
followers = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/ul/li[2]/a/span').GetAttribute("innerHTML")
print("Followers: " + followers)
【问题讨论】:
-
你有什么问题?
-
文本发生了变化,当我尝试使用 XPath 定位它时却找不到它。
-
@ZetlexDK 可以分享一下相关的HTML源码吗?或网址
标签: python selenium selenium-webdriver instagram