抓取和安装时出现 html5lib 错误

我一直在尝试从航班网站上抓取数据。这是我写的代码:


todays_date = str(date.today())

arrival_filename = todays_date+"Arrival_Data_IGI.csv"

res = requests.get("https://m.newdelhiairport.in/live-flight- 

 information.aspx?FLMode=A&FLType=D")

soup = BeautifulSoup(res.content,'lxml')

table = soup.find_all('table',{'id':'fids_row'})

df = pd.read_html(str(table))

arrival = df[0]

arrival_filename = todays_date+"_Arrival_Data_IGI.csv"

arrival.to_csv(arrival_filename)

arrival.to_csv("Arrival_Data_IGI(daily).csv")

但是当我运行代码时出现了错误。出现的错误:

http://img1.mukewang.com/614037fe0001e8e213580763.jpg

当我尝试使用 安装 html5lib 时pip install html5lib,出现以下错误:

http://img2.mukewang.com/6140380a00010f2f13620766.jpg

安装任何库或升级 pip 时出错。

“无法获取 URL https://pypi.org/simple/pip/:确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org', port=443):最大重试次数超过 url:/simple /pip/(由 SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:证书链中的自签名证书 (_ssl.c:1051)')) 引起 - 跳过”


皈依舞
浏览 275回答 2
2回答

慕雪6442864

如果您使用的是 Windows,则在 64 位版本上安装软件包时有时可能会出现问题。您可以从这里下载 64 位版本的库。然后在您下载文件的路径上打开命令提示符并键入pip install "name of the package".whl由于下载的文件是一个车轮文件。或者您可以从 Anaconda-Navigator 下载所需的包。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python