[Python] Python Requests Scraping API

Discussão em 'Python' iniciado por Stack, Março 23, 2025.

  1. Stack

    Stack Membro Participativo

    using "Network - Fetch/XHR" on aiscore.com, I found this request url: https://api.aiscore.com/v1/web/api/match/mlive?lang=8&match_id=zrkn6ivlz58cwql&country_code=IT

    I am trying to scrape data but I get "Errors 403"

    This is my code:

    import requests

    url = "https://api.aiscore.com/v1/web/api/match/mlive?lang=8&match_id=zrkn6ivlz58cwql&country_code=IT"

    headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
    }

    response = requests.get(url, headers=headers)

    if response.status_code == 200:
    data = response.json()
    print(data) # Stampare i dati
    else:
    print(f"Errors: {response.status_code}")


    Is there a way to fix this error and scrape datas?

    Continue reading...

Compartilhe esta Página