Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data ScrPing error handling using beautifulsoup4. #167

Open
imsanjoykb opened this issue Jan 19, 2022 · 0 comments
Open

Data ScrPing error handling using beautifulsoup4. #167

imsanjoykb opened this issue Jan 19, 2022 · 0 comments

Comments

@imsanjoykb
Copy link
Owner

import requests

from urllib.error import HTTPError
 

url = 'https://www.geeksforgeeks.org/implementing-web-scraping-python-beautiful-soup/amp/'
 

try:

    response = requests.get(url)

    response.raise_for_status()

except HTTPError as hp:

    print(hp)

     

else:

print("it's worked")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant