【发布时间】:2024-04-29 23:30:02
【问题描述】:
我想在 Just-Eat 中抓取表格,但表格似乎不存在! 我使用该代码:
br.open("https://www.just-eat.fr/")
form = br.get_forms()
但是表单没有检测到任何表单!但是当您继续查看代码源时,我们可以找到一个表格:
<form class="search-form autocomplete-target" action="#" id="geolocate_form_home">
我不知道如何让它被检测到!有人知道吗?
非常感谢!
【问题讨论】:
-
这个
print(br.parsed)没有在源代码中显示表单。但它显示带有网址的<iframe>。如果我使用它,它会显示有关阻止机器人/脚本的消息。 -
如果你运行
br.open("https://httpbin.org/get")然后print(br.parsed)表明它使用"User-Agent": "python-requests/2.21.0",它可能是主要问题或第一个问题。
标签: python python-3.x web-scraping robobrowser