i am trying to get lowest prices for video games from https://www.g2a.com i got Access Denied response . I already tried add different user agents and different ip and did not succeed
from bs4 import BeautifulSoup
import requests
import ssl
import urllib.request, urllib.parse, urllib.error
url_siemens_part = 'https://www.g2a.com/search?query=cyberpank'
with requests.session() as sr:
sr.headers.update({'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0'})
partUrl = sr.get(url_siemens_part)
soup = BeautifulSoup(partUrl.content,'html.parser')
print(soup)
response:
<html><head>
<title>Access Denied</title>
</head><body>
<h1>Access Denied</h1>
You don't have permission to access "http://www.g2a.com/search?" on this server.<p>
Reference #18.2d6533b8.1611493251.269dd254
</p></body>
</html>
its not duplicate , 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0','Accept-Language': 'en-US,en;q=0.5' as headers does not works