0

I am making a web scraper but i am facing some errors.help is required.

My Code:

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)

Error:

ConnectionError: HTTPSConnectionPool(host='www.google.com', port=443): 
Max retries exceeded with url: / (Caused by 
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000016945AFB0F0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed',))
Vladimir Vagaytsev
  • 2,871
  • 9
  • 33
  • 36

0 Answers0