如何使用splinter在表中查找网格?

问题描述 投票:0回答:1

我想在表格中找到这样的元素:enter image description here

我试过了

b.find_by_id('resourceTd_5897')

b.find_by_css('td#resourceTd_5897.resourceTd')

乃至

b.find_by_tag('td')

他们都提出no elements could be found with......例外。

如何在表格中找到网格?

python dom web-scraping splinter
1个回答
0
投票

等待一段时间满载页面怎么样?

from splinter import Browser
b = Browser("chrome")
b.visit("https://splinter.readthedocs.io/en/latest/tutorial.html")

if b.is_element_present_by_xpath("//div[@id='create-a-browser-instance']/h2", wait_time=5):
    # wait until the element's appearing
    print(b.find_by_xpath("//div[@id='create-a-browser-instance']/h2"))

splinter documents上查看更多信息

希望它有用..

© www.soinside.com 2019 - 2024. All rights reserved.