webdriverwait

How to click on this specific element using Selenium and C#

寵の児 提交于 2021-02-15 06:22:51
问题 I've tried lots of ways but none seem to work its not a clear id="ezidgrab" the element can be found on this url: https://www.ahem.email/mailbox/QI2R89LNDT but how do I click the email there with selenium? What I have tried: 1. driver.FindElement(By.XPath("//p[contains(text(), 'Thank you for registering your email')]")).Click(); 2. driver.FindElement(By.TagName("mat-list-item")).Click(); 3. driver.FindElement(By.ClassName("mat-list-item-content")).Click(); and the html of the link: <app-email

How to extract the text from the search results of duckduckgo using Selenium Python

五迷三道 提交于 2021-02-15 05:18:16
问题 I am trying to get the link descriptions of duckduck of search results using the following: results=browser.find_elements_by_xpath("//div[@id='links']/div/div/div[2]") description=[] for result in results: description.append(result.text) I am getting the error 'list' object has no attribute 'text'. I was able to use a similar method to get the search result titles, but for some reason I am unable to extract the text from this particular xpath. 回答1: To extract the link descriptions of the

How to extract the text from the search results of duckduckgo using Selenium Python

随声附和 提交于 2021-02-15 05:17:36
问题 I am trying to get the link descriptions of duckduck of search results using the following: results=browser.find_elements_by_xpath("//div[@id='links']/div/div/div[2]") description=[] for result in results: description.append(result.text) I am getting the error 'list' object has no attribute 'text'. I was able to use a similar method to get the search result titles, but for some reason I am unable to extract the text from this particular xpath. 回答1: To extract the link descriptions of the

Selenium is not properly determining if a page has a <title> html tag

佐手、 提交于 2021-02-11 15:08:45
问题 I'm trying to get Selenium to wait until the title tag of a web page is present when loading with Python. I've tried testing this code with other types of HTML tags and only the <body> tag didn't result in an error. wait = WebDriverWait(driver, 10) driver.get(link) wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'div'))) I expected the code to evaluate to completion but I got the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib

Webscraping: ElementNotInteractableException while trying to fill the form on this website

天大地大妈咪最大 提交于 2021-02-11 14:50:45
问题 I have been trying to scrape data from this site. I need to fill Get the precise price of your car form ie. the year, make, model etc.. I have written the following code till now: import requests import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait, Select from selenium.common.exceptions import NoSuchElementException from selenium.common

How to extract the text 73 from the text 1-16 of 73 results from the search result summary within https://www.amazon.com using Selenium and Java

ε祈祈猫儿з 提交于 2021-02-11 14:24:35
问题 I am navigating to https://www.amazon.com/ there I am looking for 'samsung tv 55 inch' setting it in the search box text field then I am trying to extract the text of (63 results [see image attached]): I can't find the correct locator and how to find it, this is my code: package com.bottomline.automation.tests.ui; import com.bottomline.automation.pageobjects.model.AmazonWebPage; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AmazonTest extends

Python +Selenium can't find element to send key

被刻印的时光 ゝ 提交于 2021-02-11 13:54:40
问题 I already deal with it for many days having no idea how to solve it... That is the element I want to get by selenium <input name="QUICKSEARCH_STRING" id="QUICKSEARCH_STRING" onfocus="setTimeout('focusSearchElem()', 100);" type="text" value=""> They all pop out the warning like this one ===> Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="QUICKSEARCH_STRING"]"} (Session info: chrome=79.0.3945.88) It is my code: import selenium.webdriver from

How to use WebDriverWait from Selenium properly through Python?

吃可爱长大的小学妹 提交于 2021-02-11 13:54:02
问题 Just thought I'd add an edit now that this has been resolved. Replacing those 2 time.sleep() took my program from 180 seconds down to 30. WebDriverWait creates a substantial improvement in runtime. Just trying to determine if I'm setting up WebDriverWait correctly. This is my working script, I use time.sleep() for x,sequence in enumerate(table.find_elements_by_xpath('//*[@id="gwzSngrOrderResultPanelRoot"]/table/tbody/tr/td[9]'),1): driver.find_element_by_xpath(f'//*[@id=

selenium.common.exceptions.TimeoutException while clicking on a button using expected_conditions presence_of_element_located in Selenium Python

℡╲_俬逩灬. 提交于 2021-02-11 13:09:20
问题 I want to create an automatic creation for Nike accounts. For that I need to add a phone number. I am coding with Python 3, Selenium and the Chrome Webdriver. This is my current code: driver.get('https://www.nike.com/de/member/settings') element2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[3]/div/div[6]/div[2]/div[2]/div/form/div[2]/div[5]/div/div/div/div[2]/button"))) driver.execute_script("arguments[0].click();", element2) time.sleep(1) This

OpenQA.Selenium.NoSuchElementException: Unable to locate element error while locating an element on a page using Selenium and C#

核能气质少年 提交于 2021-02-11 05:53:33
问题 I am trying to scrape the text 睡觉 within the page edited out the site It has the css selector: #autocplt_wrap > ul:nth-child(1) > li:nth-child(1) > span:nth-child(1) > a:nth-child(1) And x-Path: /html/body/div[2]/div[1]/div[3]/div[2]/div[1]/div/div[1]/div[2]/div/div/ul[1]/li/span/a[1] My code is: IWebDriver driver = new FirefoxDriver(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); //load webdriver driver.Manage(); driver.Navigate().GoToUrl("https://dict.naver.com