有人知道为什么Kagg会出现BeautifulSoup Connectionerror吗

2024-07-04 07:45:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在对某个特定用户的微博回复进行情绪分析

当我在googlecolab上编写代码时,它可以工作,但当我在Kaggle上尝试时,它会抛出错误。事实上,无论我用BeautifulSoup编写其他页面的代码,它都会给我同样的错误

import requests
from bs4 import BeautifulSoup

url = 'https://twitter.com/jguaido/status/1163970836795207680'
source = requests.get(url).text
soup = BeautifulSoup(source,'html.parser')

replies=soup.find_all(class_="TweetTextSize")

ConnectionError:HTTPSConnectionPool(主机='推特网站',port=443):url:/jguaido/status/1163970836795207680超出了最大重试次数(由NewConnectionError引起(':无法建立新连接:[Errno-3]名称解析中的临时失败',))

我希望那个美女能在卡格尔身上工作。你知道吗


Tags: 代码用户importurlsourcestatus错误页面
1条回答
网友
1楼 · 发布于 2024-07-04 07:45:51

你为你的内核激活了互联网接入吗?你知道吗

Go to Settings -> Internet and select Internet connected. Your Kernels session restarts and the newly started session is enabled to access the Internet.

https://www.kaggle.com/product-feedback/63544

相关问题 更多 >

    热门问题