trying scrape a html page with requests module in python

Posted by Abdul7676@reddit | programming | View on Reddit | 8 comments

I want to get the search results of pyautogui in https://pypi.org/search/

and then print it in html format but for some reason it prints error

if you have any idea to solve this issue please help

code:

import requests




query = "https://pypi.org/search/?q="+'pyautogui'
print()
print(query)


#Fetch the results page with requests module
res = requests.get(query)
print(res.text)

output:

https://pypi.org/search/?q=pyautogui

Client Challenge