简体   繁体   English

不能从页面 [Selenium[

[英]Can't select element from page [Selenium[

I have tried to scrap info from that site - specifically, from a table.我试图从该站点中删除信息-特别是从表格中。 Every time I occur, info that elements doesn't exist.每次我发生时,元素不存在的信息。

https://polygonscan.com/token/0x64a795562b02830ea4e43992e761c96d208fc58d https://polygonscan.com/token/0x64a795562b02830ea4e43992e761c96d208fc58d

I try to add time.slep(5) to my code or scrolling down function to load all element - ineffective.我尝试将time.slep(5)添加到我的代码中或向下滚动 function 以加载所有元素 - 无效。

Do you have any advice for me?你对我有什么建议吗?

One way to try solve it, its using the Xpath of the element or the relative position of the same, to make Selenium, get allways the same "line" of position to return the "value" of the information that you are searching. One way to try solve it, its using the Xpath of the element or the relative position of the same, to make Selenium, get allways the same "line" of position to return the "value" of the information that you are searching.

Ex1:find_element(:xpath,"//*[@id="wmd-input"]")#in that case it's the input of this check box. Ex1:find_element(:xpath,"//*[@id="wmd-input"]")#在这种情况下就是这个复选框的输入。

If it doesnt work, try this one.如果它不起作用,试试这个。

Ex2: browser.implicitly_wait(30) #makes a timer to load all the informations from the web to your machine. Ex2: browser.implicitly_wait(30) #makes a timer 将所有信息从 web 加载到您的机器上。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM