【发布时间】:2020-12-07 00:17:18
【问题描述】:
我正在尝试编写一个返回 TD 标记中所有文本的脚本,但无法显示完整代码,但我正在使用
instances = self.driver.find_element_by_xpath("//*[contains(@class, 'tblrow')]")
识别“行”然后需要返回位于的文本
<td align="left" I need this, And this <\td>
我还使用 .find_element_by_xpath 确定了表所在的主体。每次我都尝试
print(instances.text())
我尝试过遇到 unicode 错误
print(instances.text().decode("utf-8", "strict")
如果不成功,请提出任何问题。
【问题讨论】:
-
你到底看到了什么 unicode 错误?
标签: python selenium selenium-webdriver html-table