locating element with selenium after login - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: locating element with selenium after login (/thread-7539.html) |
locating element with selenium after login - sumandas89 - Jan-15-2018 I wrote a script to locate the search bar in my facebook home page. Code for login into my facebook profile using selenium worked perfectly. I got the home page, but the code for locating the search bar is not working correctly. I tried the to locate the search bar using the following code - elem = driver.find_element_by_name("q")and I am getting the below error message - What is the reason of this error? and what is the solution?
RE: locating element with selenium after login - metulburr - Jan-15-2018 You either 1) didnt give it time to locate that element (add a time.sleep(3) before finding the name to test to make sure its loaded) or you can try the xpath/html/body/div[1]/div[2]/div/div[1]/div/div/div/div[1]/div[2]/div/form/div/div/div/div/input[2]
|