when scraping from website using bs4 it showing response object as access denied and Forbidden how to solve this?
Asked
Active
Viewed 233 times
0
-
The question is similar [HTTPError: HTTP Error 403: Forbidden](https://stackoverflow.com/questions/13055208/httperror-http-error-403-forbidden/13055444#13055444) – Supreet Sethi Nov 03 '17 at 05:50
-
Possible duplicate of [HTTPError: HTTP Error 403: Forbidden](https://stackoverflow.com/questions/13055208/httperror-http-error-403-forbidden) – Supreet Sethi Sep 02 '19 at 01:13
1 Answers
0
Make sure that you have added the required headers such as 'User-Agent' before firing the get Request. In most cases, if 'User-Agent' is not provided, you'll end up with 403 response.

Haagenti
- 5,602
- 1
- 9
- 17
-
Good answer, to make it more clear: you should use a browser's User-Agent, which you can view by browsing to `whichbrowser.net` in your favorite browser – Chang Qian Nov 03 '17 at 04:10
-
correct, for instance mozillas UA would be, headers = {'User-Agent':'Mozilla/5.0'} – Haagenti Nov 03 '17 at 04:13
-
I am using google chrome to scrape data from website using beautifulsoup – shashikala rs Nov 03 '17 at 06:37