Member-only story
EASIEST Way to Scrape Stake.com Premier League Football Match Odds using Python
Today, our focus turns to scraping Stake.com, the most popular crypto gambling site. We will focus on Football Match odds but the same principles can be applied across any sport with some modification.
The link to the full code can be found here
Now lets get started.
First import your libraries and create a function called driver_code which just contains the logic for creating an instance of chromedriver. You can find the libraries I imported and an example function in the github repo above.
You can run this driver headlessly if you want just simply uncomment this line of code
# options.add_argument('--headless')
We will create three more functions to complete various actions, first is a simple accept cookies function as shown below.
def accept_cookies(driver):
cookies = driver.find_elements(By.CLASS_NAME, "button.variant-action.size-sm.align-center.full-width.svelte-1epmied")
if(len(cookies) > 0):
cookies[0].click()
else:
print("No Cookies to Click")