我一直试图从新德里国际机场的网站上搜集国内航班的到港和离港数据。 我几乎什么都试过了,但无法提取数据。 当我运行代码时,它什么也不返回。我在另一个机场网站上尝试了类似的代码,但它成功了。 这是我写的代码。你知道吗
res = requests.get("https://m.newdelhiairport.in/live-flight- information-all.aspx?FLMode=A&FLType=D")
soup = BeautifulSoup(res.content,'html5lib')
table = soup.find_all('tbody',{'class':'arr_dep_table_body'})
print(table)
这是到网站:“https://m.newdelhiairport.in/live-flight-information-all.aspx?FLMode=A&FLType=D”
如前所述,您可以使用数据来源的替代URL。您需要添加标题。你知道吗
我从“网络”选项卡中提取了URL。我打开“网络”选项卡并重新加载页面,然后检查XHR web流量:
相关问题 更多 >
编程相关推荐