[Python] BeautifulSoup 4 - Web scraping soccer matches for 'today'

Discussão em 'Python' iniciado por Stack, Abril 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm very new to python and trying to webscrape soccer matches for 'today' from the fox sports website: https://www.foxsports.com/scores/soccer. Unfortunately, I keep running into issues with


    'AttributeError: 'NoneType' object has no attribute 'find_all''
    ​

    and can't seem to get the teams for that day. This is what I have so far:

    import bs4
    import requests

    res = requests.get('foxsports.com/scores/soccer')
    soup = bs4.BeautifulSoup(res.text, 'html.parser')
    results = soup.find("div", class_="scores-date")
    games = results.find("div", class_="scores")

    print(games)

    Continue reading...

Compartilhe esta Página