webdriverwait

Automating jQuery based bootstrap dropdown using Selenium and Java

徘徊边缘 提交于 2021-02-02 09:37:07
问题 I am trying to list all elements from the bootstrap dropdown and then select a certain value. However, it returns 0 values. Any suggestions will be greatly appreciated. driver.findElement(By.id("imgSelectButton")).click(); Thread.sleep(3000); List<WebElement> list = driver.findElements(By.xpath("//ul/li[@class='logoSelectOpt']//li")); System.out.println(list.size()); for(int i=0; i<list.size(); i++){ System.out.println(list.get(i).getText()); if (list.get(i).getText().contains("History")){

How to paginate through the page numbers when href contains javascript:__doPostBack()

别来无恙 提交于 2021-02-02 09:36:27
问题 I'm trying to scrape this website http://www.mfa.gov.tr/sub.ar.mfa?dcabec54-44b3-4aaa-a725-70d0caa8a0ae but when I want to go to next page I can't because the link doesn't change you will find that pages links are like that href="javascript:__doPostBack('sb$grd','Page$1')" I have a code that I tried but it only goes to page 2 and then gave me an error: tale element reference: element is not attached to the page document from selenium import webdriver url = 'http://www.mfa.gov.tr/sub.ar.mfa

Automating jQuery based bootstrap dropdown using Selenium and Java

大兔子大兔子 提交于 2021-02-02 09:36:04
问题 I am trying to list all elements from the bootstrap dropdown and then select a certain value. However, it returns 0 values. Any suggestions will be greatly appreciated. driver.findElement(By.id("imgSelectButton")).click(); Thread.sleep(3000); List<WebElement> list = driver.findElements(By.xpath("//ul/li[@class='logoSelectOpt']//li")); System.out.println(list.size()); for(int i=0; i<list.size(); i++){ System.out.println(list.get(i).getText()); if (list.get(i).getText().contains("History")){

How to paginate through the page numbers when href contains javascript:__doPostBack()

三世轮回 提交于 2021-02-02 09:35:34
问题 I'm trying to scrape this website http://www.mfa.gov.tr/sub.ar.mfa?dcabec54-44b3-4aaa-a725-70d0caa8a0ae but when I want to go to next page I can't because the link doesn't change you will find that pages links are like that href="javascript:__doPostBack('sb$grd','Page$1')" I have a code that I tried but it only goes to page 2 and then gave me an error: tale element reference: element is not attached to the page document from selenium import webdriver url = 'http://www.mfa.gov.tr/sub.ar.mfa

Unable to locate element using selenium chrome webdriver in python selenium

China☆狼群 提交于 2021-02-02 09:32:37
问题 I am new to python and trying to do some webscraping but have some real issues. May be you can help me out. HTML: <input autocomplete="off" type="search" name="search-search-field" placeholder="150k companies worldwide" data-cy-id="search-search-field" class="sc-dnqmqq grpFhe" value=""> The first part of my code looks as follows and works good without having any issues: driver.get("https:") login = driver.find_element_by_xpath(email_xpath).send_keys(email) login = driver.find_element_by_xpath

How to perform multiple actions and click on the link with text as Member Login on the url http://www.spicejet.com/ through selenium-webdriver

寵の児 提交于 2021-02-02 03:46:47
问题 I tried the below code but it is not mouse hovering and clicking on 'Member login' WebElement lgn = driver.findElement(By.id("ctl00_HyperLinkLogin")); WebElement ssm = driver.findElement(By.xpath("//a[contains(text(), 'SpiceCash/SpiceClub Members')]")); WebElement cgm = driver.findElement(By.xpath("//a[contains(text(),'Member Login')]")); Actions a1 = new Actions(driver); a1.moveToElement(lgn).moveToElement(ssm).moveToElement(cgm).click().build().perform(); 回答1: To invoke click() on the

How to perform multiple actions and click on the link with text as Member Login on the url http://www.spicejet.com/ through selenium-webdriver

旧街凉风 提交于 2021-02-02 03:43:23
问题 I tried the below code but it is not mouse hovering and clicking on 'Member login' WebElement lgn = driver.findElement(By.id("ctl00_HyperLinkLogin")); WebElement ssm = driver.findElement(By.xpath("//a[contains(text(), 'SpiceCash/SpiceClub Members')]")); WebElement cgm = driver.findElement(By.xpath("//a[contains(text(),'Member Login')]")); Actions a1 = new Actions(driver); a1.moveToElement(lgn).moveToElement(ssm).moveToElement(cgm).click().build().perform(); 回答1: To invoke click() on the

WebScraping JavaScript-Rendered Content using Selenium in Python

僤鯓⒐⒋嵵緔 提交于 2021-02-02 02:09:03
问题 I am very new to web scraping and have been trying to use Selenium's functions to simulate a browser accessing the Texas public contracting webpage and then download embedded PDFs. The website is this: http://www.txsmartbuy.com/sp. So far, I've successfully used Selenium to select an option in one of the dropdown menus "Agency Name" and to click the search button. I've listed my Python code below. import os os.chdir("/Users/fsouza/Desktop") #Setting up directory from bs4 import BeautifulSoup

WebScraping JavaScript-Rendered Content using Selenium in Python

浪尽此生 提交于 2021-02-02 02:08:45
问题 I am very new to web scraping and have been trying to use Selenium's functions to simulate a browser accessing the Texas public contracting webpage and then download embedded PDFs. The website is this: http://www.txsmartbuy.com/sp. So far, I've successfully used Selenium to select an option in one of the dropdown menus "Agency Name" and to click the search button. I've listed my Python code below. import os os.chdir("/Users/fsouza/Desktop") #Setting up directory from bs4 import BeautifulSoup

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

*爱你&永不变心* 提交于 2021-02-01 05:14:57
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My