I want to scrape Betway.com. However, when I try to request the page using the request library, I am getting a 403 Forbidden response.
I stumbled upon the following thread: Using headers with the Python requests library's get method It says that I can make my way around the problem using headers. I tried and it still didn't work. Here is my code:
import requests
url = "https://betway.com/fr/sports/cat/ufc---martial-arts"
headers = {'authority': "app.launchdarkly.com",
'method': "OPTIONS",
'path': "/sdk/goals/5ce3ca97d7d666081b7523a7",
'scheme': "https",
'accept': "*/*",
'accept-encoding': "gzip, deflate, br",
'accept-language': "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7",
'access-control-request-headers': "x-launchdarkly-user-agent",
'access-control-request-method': "GET",
'origin': "https://betway.com",
'referer': "https://betway.com/",
'sec-fetch-dest': "empty",
'sec-fetch-mode': "cors",
'sec-fetch-site': "cross-site"}
result = requests.get(url, headers=headers)
Can you please help me find a solution. Also, it would be appreciated if you may share some easy resources on the field and what headers may mean for example. Thanks a lot.