While doing automation testing on this website http://www.scstrade.com/TechnicalAnalysis/tvchart/ i was unable to find the element using selenium.
i want to find the search bar element at the top which is used to search for stocks and then pass the name of desired stock in that bar using selenium.
Here is the xpath for the search bar :
/html/body/div[1]/div[2]/div/div/div[1]/div/div/div/div/div[1]/div/div/input
here is my code:
from selenium import webdriver
driver = webdriver.Chrome("D:\PyCharm Projects\Web Automation\drivers\chromedriver.exe")
driver.get("http://www.scstrade.com/TechnicalAnalysis/tvchart/")
driver.find_elements_by_xpath('/html/body/div[1]/div[2]/div/div/div[1]/div/div/div/div/div[1]/div/div/input')
Output : []
i also tried finding the element using the class name:
driver.find_element_by_class_name('input-3lfOzLDc-')
which gives me this error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"class name","selector":"input-3lfOzLDc-"}
(Session info: chrome=83.0.4103.61)
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.17134 x86_64)
The element i am trying to access only has the class name so i can't try using the id. I also tried switching to the frame first but i can't even find the frame element for this website using selenium.