I want to scrape this page, using Selenium in Python with Chrome driver
I am interested only on opening odds of Bet365.
bet365_row = driver.find_element_by_xpath("//div[@id='odds-content']").find_element_by_tag_name('tbody').find_element_by_xpath("//tr[@data-bid='16']")
odd1= driver.find_element_by_xpath("//tr[@data-originid='1']").find_element_by_xpath("//td[@class='table-main__detail-odds table-main__detail-odds--first']").find_element_by_xpath("//span[@class='table-main__detail-odds--hasarchive']").text
print(odd1)
I write this lines of the code, but i can scrape only the first odd of the table on 10Bet row, but wish the opening odd on bet365 row.
driver.find_element_by_xpathin other words you'll get only the first occurence. try :driver.find_elements_by_xpath(...)- Y.Berramadriver.find_elements_by_xpath("//div[@id='odds-content']") bet365odd=driver.find_elements_by_xpath("//tr[@data-bid='16']").find_elements_by_xpath("//tr[@data-originid='1']").find_elements_by_xpath("//td[@class='table-main__detail-odds table-main__detail-odds--first']").find_elements_by_xpath("//span[@class='table-main__detail-odds--hasarchive']").texti write this, add find_elements, but i got this error: AttributeError: 'list' object has no attribute 'find_elements_by_xpath' - pygian81find_elements_by_xpathreturn a list of selenium object. If it was me i would do something like this (look in my edited response) - Y.Berrama