无法建立新连接:[Errno 11002]getaddrinfo失败

2024-04-27 02:25:35 发布

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

我在做一个刮板,但我面对一些错误。帮助是必需的。在

我的代码:

import requests

from bs4 import BeautifulSoup

page = requests.get("https://www.google.com")

soup = BeautifulSoup(page.content, 'html.parser')

for x in soup.find_all('a'):
    print(x)

错误:

^{pr2}$

Tags: 代码fromhttpsimport刮板comgetwww