Python Forum
Extract data from sports betting sites
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract data from sports betting sites
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
from bs4 import BeautifulSoup
import urllib.request

url = ""
    page = urllib.request.urlopen(url)
    print("An error occured.")

soup = BeautifulSoup(page, 'html.parser')
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
from bs4 import BeautifulSoup
import urllib.request
import re
url = ""
    page = urllib.request.urlopen(url)
    print("An error occured.")

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

regex = re.compile("participant")
content_lis = soup.find_all('div', attrs={'class': regex})
thank you who will help me
That site uses a lot of javascript.
You will need to use selenium to expose the javascript, after you do this, you can finish with Beautiful Soup
Or do it all in selenium
there are good selenium tutorial within the web scraping tutorial on this forum
web scraping part 1
web scraping part 2
I'm working on a similar Project, Selenium will easily do that work for you especially if you encounter a site using Ajax
First of all, giving the amount of time that has passed since the initial post on this thread, I would like to get an update if you've managed to extract data from sport betting websites. This is something I would be interested in. At the same time, I can't imagine why would you need to do this, and this is why I would like to know what advantages you might have from extracting data from sports betting websites. Recently, I have read an article on how to cheat online casinos, and I found it to be very interesting.
buran write Mar-30-2021, 04:47 PM:
Link removed
The tutorial links in post #2 are still quick and valid.
They apply to all types of sites, including sports sites.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extract data from a table Bob_M 3 970 Aug-14-2020, 03:36 PM
Last Post: Bob_M
  Extract data with Selenium and BeautifulSoup nestor 3 1,539 Jun-06-2020, 01:34 AM
Last Post: Larz60+
  Extract json-ld schema markup data and store in MongoDB Nuwan16 0 1,192 Apr-05-2020, 04:06 PM
Last Post: Nuwan16
  Extract data from a webpage cycloneseb 5 1,361 Apr-04-2020, 10:17 AM
Last Post: alekson
  Cannot Extract data through charts online AgileAVS 0 748 Feb-01-2020, 01:47 PM
Last Post: AgileAVS
  Cannot extract data from the next pages nazmulfinance 4 1,190 Nov-11-2019, 08:15 PM
Last Post: nazmulfinance
  How to use Python to extract data from Zoho Creator software on the web dan7055 2 2,194 Jul-05-2019, 05:11 PM
Last Post: DeaD_EyE
  Python/BeautiifulSoup. list of urls ->parse->extract data to csv. getting ERROR IanTheLMT 2 2,034 Jul-04-2019, 02:31 AM
Last Post: IanTheLMT
  Help to extract data from web prasadmathe 4 1,591 May-20-2019, 10:59 PM
Last Post: michalmonday
  [Python 3] - Extract specific data from a web page using lxml module Takeshio 9 4,215 Aug-25-2018, 08:46 AM
Last Post: leotrubach

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020