'scrape data after hover over element using selenium
From this link:
https://www.oddsportal.com/tennis/usa/wta-miami/golubic-viktorija-swiatek-iga-j9oF2Lr6/,
I want to scrape data that appears after hover over this element 24%:

the text I want to get is 4 out of 17 users predicted this
I tried using selenium but return error:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome(service=Service("C:/chromedriver.exe"), options=options)
driver.get(u)
s = driver.find_element(by=By.CSS_SELECTOR, value='.foot.predictions .center.disabled .pred')
action = ActionChains(driver)
action.move_to_element(s).perform()
print(driver.find_element(by=By.CSS_SELECTOR, value='.foot.predictions .center.disabled .pred').text)
return error:
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".foot.predictions .center.disabled .pred"}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
