I'm trying to scrape the following URL for all football (soccer) matches for that day: https://www.soccerstats.com/matches.asp?matchday=2&daym=tomorrow
My code used to work but the website has since changed that you now need to click "I agree to cookies" button before the site loads the page. This is now causing issues with my code. Are there any solutions to this?
Any help is much appreciated.
I've tried looking at the text output from bs4 and its clear the site has not loaded, instead the "I agree to cookies" text can be seen in the output, which means it is not getting passed this stage.
from bs4 import BeautifulSoup
import requests
url = "https://www.soccerstats.com/matches.asp?matchday=2"
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data, 'html.parser')
all_matches = []
all_matches = re.findall(r"""<a class='button' style='background-color:#AAAAAA;font-color=white;' href='(.*?)'>""", data)
Output should list individual match url's.