我可以下拉一个HTML页面,但不确定如何访问隐藏在按钮单击下的文本数据,因为数据不在页面源中
from requests import get
URL = 'https://melvyl.on.worldcat.org/oclc/1076548274'
step1 = get(URL)
print(steps.text)
# how do I navigate to `Check Availability`?
我希望在您单击UC Berkeley Libraries旁边的Check Availability
时,以交互方式显示数据。这将打开一个包含我要查找的电话号码的框(例如“DT157.675.M37 2019”)
当您监控网络流量[在浏览器中转到更多工具>;开发者工具>;网络或在chrome浏览器中按
Ctrl + Shift + I
,然后选择网络,并过滤XHR
],您将看到当您单击Check Availability
时,浏览器向另一个URL发出get请求以获取数据范例
尝试不同的地方,似乎唯一改变的是
id_
。如果您知道ID,那么我们可以通过循环收集所有数据:相关问题 更多 >
编程相关推荐