単純なget / postリクエストはPython 3ではブロックされていますが、Python 2ではブロックされていません
私はpython 3で単純なWebスクレイパーに取り組んでいますが、getまたはpostリクエストを送信すると、応答は403です。python2では正常に動作します。両方のバージョンで同じバージョンのリクエストライブラリを使用しています。私も試しましたVerify=False/Trueが、両方のバージョンの違いは残っています。 リクエスト= 2.22.0 certifi = 2019.9.11 from requests import get url = 'https://www.gamestop.com/' header = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.5', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0', 'DNT': '1', 'Upgrade-Insecure-Requests': '1', 'Connection': 'keep-alive', 'Host': 'www.gamestop.com' } res = get(url, headers=header, verify=False).status_code print(res) # …