r/learnpython • • Oct 26 '26

Can't download website html code, web scrapping ,automate the boring stuff with python

I'm currently learning webscrapping with automate the boring stuff with python> In one example we use the module requests like this

url = f"https://pypi.org/search/?q={search}"

resp = requests.get(url)

when i print resp.text there are this error message in the html code.

"A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser."

"JavaScript is disabled in your browser"

my browser is chrome I tried using microsoft edge .

0 Upvotes

12 comments sorted by

View all comments

2

u/zanfar Oct 26 '26
  1. You ARE downloading HTML. An HTTP error is an example of successful communication. The error is your request, not your process.
  2. The requests modules does not use a browser. You are not using Chrome nor Edge in your example.