Hi, as the title suggests, I would like to extract data from sports betting sites, with this code I download the html of the site
then I can't go on, if I want to extract the participating teams I tried with the re module and this code but it doesn't work
thank you who will help me
1 2 3 4 5 6 7 8 9 10 11 |
from bs4 import BeautifulSoup import urllib.request try : page = urllib.request.urlopen(url) except : print ( "An error occured." ) soup = BeautifulSoup(page, 'html.parser' ) print (soup) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from bs4 import BeautifulSoup import urllib.request import re try : page = urllib.request.urlopen(url) except : print ( "An error occured." ) soup = BeautifulSoup(page, 'html.parser' ) #print(soup) regex = re. compile ( "participant" ) content_lis = soup.find_all( 'div' , attrs = { 'class' : regex}) print (content_lis) |