我想在网页上填一张表格鬼.py. 目前我正努力处理正确的表单字段,css选择器让我头疼。所以我决定让鬼.py做这项工作,给我一个包含表单字段和标识符的列表。到目前为止,我已经尝试过:
import ghost
g = ghost.Ghost()
with g.start(display=True) as session:
page, extra_resources = session.open("http://www.surfbirds.com/identifier/what-british-bird.htm")
if page.http_status == 200 and \
'Head characters' in page.content:
print("got it!")
ressources =
session.evaluate('document.getElementByName("geog");')
print("ressources: {}".format(ressources))
这将引发一个错误:
^{pr2}$我不知道是什么原因造成的,有人能告诉我该往哪里看吗?在
该页上没有名为
<geog>
的标记。您可能想查询名称为geog
的表单元素:相关问题 更多 >
编程相关推荐