I want to get all the matches of the website in the code, it is the website for spaniards so change to your country's one, just select the tennis part of the website. I have seen they are in a <div>
whose class name is "category-container"
, so with this code it should work:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
driver_path = 'chromedriver.exe'
options = webdriver.ChromeOptions()
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_argument("--incognito")
options.add_argument('--start-maximized')
options.add_argument('--disable-extensions')
driver = webdriver.Chrome(driver_path, options=options)
driver.maximize_window()
driver.get('https://www.marathonbet.es/es/popular/Tennis+-+2398')
matches = driver.find_elements_by_xpath('//div[@class="category-container"]')
But the problem is that once it arrives to the ITF Egypt, more or less half the website, it stops recording in the variable matches
the divs positions, I don't know why this happens. Does someone know what is the problem and ,if possible, a solution?