I wrote this simple python code:
>>> import requests
>>> r = requests.get("http://prnt.sc/")
>>> r.status_code
520
i want to download the page at "http://prnt.sc/"
and i can visualize it correctly using my browser (Mozilla) but with python i really can't.
I already tried changing and randomising my User-Agent using a python module named fake_useragent
, but nothing changes.
I think this problem may be caused by the fact that python takes a different traceroute than my browser.
If I print r.text
i get a cloudflare standard page error.
Including a real User-Agent solved it for me:
>>> requests.get("http://prnt.sc/", headers={'User-Agent': 'Mozilla/5.0 (Platform; Security; OS-or-CPU; Localization; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)'}).status_code
200
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With