有谁知道为什么 BeautifulSoup Connection-error 出现在 Kaggle 中

does anyone know why BeautifulSoup Connection-error appears in Kaggle

我正在对特定用户的推文回复进行情绪分析

当我在 google colab 上编写代码时它可以工作,但是当我在 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(host='twitter.com', port=443): Max retries exceeded with url: /jguaido/status/1163970836795207680 (由 NewConnectionError(': 建立新连接失败: [Errno -3] 名称解析暂时失败',))

我希望 BeautifulSoup 适用于 Kaggle。

您是否为内核激活了 Internet Access?

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