【发布时间】:2022-01-28 20:22:24
【问题描述】:
我找不到任何从 python playwright page.locator(selector, **kwargs) 返回外部 html 的方法。
我错过了什么吗?
locator.inner_html(**kwargs) 确实存在。但是,我正在尝试使用 pandas.read_html,但它在表定位器内部 html 上失败,因为它会触发表标记。
我目前正在做的是使用 bs4 来解析 page.content()。 类似:
soup = BeautifulSoup(page.content(), 'lxml')
df = pd.read_html(str(soup.select('table.selector')))
【问题讨论】:
标签: python playwright playwright-python