2021年4月9日星期五

Not able to locate text field in a webpage

I have created code

from selenium import webdriver  from selenium.webdriver.common.keys import Keys  driver = webdriver.Firefox()  driver.get("https://www.moneycontrol.com")  

I wanted to add code as "IOC" in search bar. I am not able to locate search box to enter and hit enter.

inputElement = driver.find_element_by_id("search_str")  inputElement.send_keys('IOC')  inputElement.send_keys(Keys.ENTER)  inputElement.submit()   

Can anyone guide on how can we enter value and hit enter?

https://stackoverflow.com/questions/67030650/not-able-to-locate-text-field-in-a-webpage April 10, 2021 at 11:56AM

没有评论:

发表评论