I am looking at this page. I am trying to use Selenium and chromdriver to scrape this data (shown by the red marker):
Here is my Python code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from time import sleep
chrome_options = Options()
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("disable-infobars")
driver = webdriver.Chrome(executable_path="/ABC/chromedriver", chrome_options=chrome_options)
driver.get("https://finance.yahoo.com/quote/IBM")
sleep(10)
estimated = driver.find_element_by_class_name("IbBox Ta(start) C($tertiaryColor)")
But the code does not get the Est. Return
and after a long wait it returns this error message:
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: An invalid or illegal selector was specified
What am I doing wrong and what is the best and fastest way to get the Est Return
value from the page?
UPDATE: Here is what I see if I use inspect element in Chrome: