[Python] "How do I get data from a table with an ID in BeautifulSoup?

Discussão em 'Python' iniciado por Stack, Setembro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to get data from the table with id='stats_standard' using the BeautifulSoup and requests libraries, but I have tried various methods like using find and select, and I still receive None or []. Does anyone have a solution?

    import requests
    from bs4 import BeautifulSoup

    url = 'https://fbref.com/en/comps/9/2023-2024/stats/2023-2024-Premier-League-Stats'

    page = requests.get(url)

    soup = BeautifulSoup(page.text, 'html.parser')

    table = soup.find('table', id='stats_standard')
    print(table) # None


    i want to get data from the table

    Continue reading...

Compartilhe esta Página