I'm trying to automate search procedure on facebook. I used the following code
search = driver.find_element_by_xpath('//*[@id="mount_0_0_ij"]/div/div[1]/div/div[2]/div[2]/div/div/div[1]/div/div/label/input')
search.send_keys('foo') # search for 'foo'
submit = driver.find_element_by_css_selector('#jsc_c_11 > div > a > div > div.hpfvmrgz.g5gj957u.buofh1pr.rj1gh0hx.o8rfisnq > span > span')
submit.click()
Note that I had attempted the same procedure beforehand using
WebDriverWait(f.browser, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="mount_0_0_ij"]/div/div[1]/div/div[2]/div[2]/div/div/div[1]/div/div/label/input'))).send_keys("foo")
To no avail. I keep getting the same error
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="mount_0_0_ij"]/div/div[1]/div/div[2]/div[2]/div/div/div[1]/div/div/label/input"}
with a TimeoutException for the last entry.
I have managed to automate login using selenium but these NoSuchElementExceptions occur so frequently, I'm starting to wonder if there's a problem with my device
Note : the following code works just fine for my coworkers