![]() ![]() Time.sleep(8) #I can't use WebDriverWait lolĭriver.find_element(By.CSS_SELECTOR,'#actions-menu-primary > E-mail"]').click()ĭriver.find_element(By.CLASS_NAME,'select2-input').send_keys(email_address)#type subjectĭriver.find_element(By.ID, 'body').send_keys(content)#type messageĭriver.find_element(By.ID, 'compose-form-submit-send'). Options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'ĭriver = webdriver.Firefox(executable_path=r"C:\Users\geckodriver\geckodriver.exe",ĭriver.find_element(By.ID, 'login-button').click()ĭriver.find_element(By.ID, 'login-password').send_keys('***********')ĭriver.find_element(By.CSS_SELECTOR,'button.btn:nth-child(12) > span:nth-child(1)').click() What should I do?a sampleof the code below To interface with a browser (Firefox in our case), Selenium requires a driver (GeckoDriver in our case), which will need to be in your PATH (e. geckodriver uses the temporary directory to store Firefox profiles created during the run. By ID, CLASS_NAME, XPATH, you name it and it still doesn't work. This article on ChromeDriver and GeckoDriver in Selenium will give you a brief idea about how these drivers helps in instantiating the browsers and perform various testing. Using geckodriver to launch Firefox inside a sandbox - for example a Firefox distribution using Snap or Flatpak - can fail with a 'Profile not found' error if the sandbox restricts Firefox's ability to access the system temporary directory. I keep getting the NoSuchELementException no matter what kind of selector I used. But I kept failing at it so I asked for a solid 8 seconds wait before proceeding, then 10s, then 15s yet for the life of me, I cannot select it. ![]() At first I thought the Javascript in the background was a problem so I tried the "WebDriverWait" method. I managed to log-in my account and go to the Email section. I am writing a script that asks for a valid email (checked with RegEx), a subject and a content before using my account to mail it. ![]() I am trying out selenium as a newbie and this has been frustrating so far. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |