webdriverwait

How to make selenium wait before getting contents from the actual website which loads after the landing page through IEDriverServer and IE

人盡茶涼 提交于 2021-02-04 08:21:44
问题 driver = webdriver.Ie("C:\\IEDriverServer.exe") driver.get(testurl) driver.refresh() time.sleep(5) data = driver.find_element_by_id("__content0-value-scr") So I'm trying to find an element by it's id using Selenium (Python) and Internet Explorer, because I'm limited to Internet Explorer due to company regulations. My problem is as follows: on driver.get(testurl) , selenium loads the page but IE first starts up with the IEDriver landing page. Only after that, it loads the requested url. The

How to wait until all loaders disappears using Selenium WebDriver through Java

旧巷老猫 提交于 2021-02-04 08:18:22
问题 I am using selenium web driver and I need to wait until all loaders disappear. I have 12 widgets on dashboard page and I need to wait until all widgets are loaded. Loader shows on each widget. I have used both following ways but nothing works and no errors, it just passes on to next statement. new WebDriverWait(driver,60) .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[contains(text(),'Loader')]"))); WebDriverWait wait2 = new WebDriverWait(driver,60); wait2.until

How to click a dynamic link with in a drupal 8 website using xpath/css selector while automating through Selenium and Python

三世轮回 提交于 2021-02-04 08:12:12
问题 I am trying to click on an edit tab link, and its in the form of a hyperlink in an unordered list. Here is the HTML: <li><a href="/node/2658/edit" data-drupal-link-system-path="node/2658/edit">Edit</a></li> I have been trying to use driver.find_element_by_link_text('Edit') to find the element, however always get a NoSuchElementException . I have also used the by partial text fxn, with all variations of the html, and receive the same error. There is also the following html I found that

How to download multiple files from a site selecting each option of a dropdown using Selenium in python

≯℡__Kan透↙ 提交于 2021-02-04 08:09:29
问题 I am trying to download multiple files from a site using Selenium in python using the following code. from selenium import webdriver import pandas as pd driver = webdriver.Chrome('chromedriver.exe') driver.maximize_window() driver.get('https://www10.goiania.go.gov.br/TransWeb/FuncionariosExportarPopUp.aspx?_=1590514086637') element = driver.find_element_by_id('WebPatterns_wt12_block_wtMainContent_wtcboReferencia') all_options = element.find_elements_by_tag_name("option") selectYear = Select

Getting specific elements in selenium

二次信任 提交于 2021-02-04 08:01:33
问题 I am trying to get the elements displayed as N06D-X N07X R01A-C01 S01G-X01 in the following image: Now, I got something like the WebDriver in this way: who = driver.find_element_by_tag_name("span").find_elements_by_tag_name("p") and get an output like this: [<selenium.webdriver.remote.webelement.WebElement (session="1c044455cf883fdedf6845bcd456bfab", element="0.23338884730774767-2")>] I am working on Mac Catalina and when I type: who.text it returns an empty list for some reason. I got quite

StaleElementReferenceException even after adding the wait while collecting the data from the wikipedia using web-scraping

时间秒杀一切 提交于 2021-02-02 10:02:32
问题 I am a newbie to the web-scraping. Pardon my silly mistakes if there are any. I have been working on a project in which I need a list of movies as my data. I am trying to collect the data from the wikipedia using web-scraping. Following is my code for the same: def MoviesList(years, driver): for year in years: driver.implicitly_wait(150) year.click() table = driver.find_element_by_xpath('/html/body/div[3]/div[3]/div[5]/div[1]/table[2]/tbody') movies = table.find_elements_by_xpath('tr/td[1]/i

StaleElementReferenceException even after adding the wait while collecting the data from the wikipedia using web-scraping

心已入冬 提交于 2021-02-02 09:56:26
问题 I am a newbie to the web-scraping. Pardon my silly mistakes if there are any. I have been working on a project in which I need a list of movies as my data. I am trying to collect the data from the wikipedia using web-scraping. Following is my code for the same: def MoviesList(years, driver): for year in years: driver.implicitly_wait(150) year.click() table = driver.find_element_by_xpath('/html/body/div[3]/div[3]/div[5]/div[1]/table[2]/tbody') movies = table.find_elements_by_xpath('tr/td[1]/i

Python Selenium cant find the Add photo and video button element on Facebook

拈花ヽ惹草 提交于 2021-02-02 09:55:13
问题 Im trying to upload an image to facebook and im unable to click on the Add photo and video button. When im looking at the html this is the element im trying to click: <input aria-label="Add Photo or Video" accept="video/*, video/x-m4v, video/webm, video/x-ms-wmv, video/x-msvideo, video/3gpp, video/flv, video/x-flv, video/mp4, video/quicktime, video/mpeg, video/ogv, .ts, .mkv, image/*, image/heic, image/heif" containerclassname="_5g_r" multiple="" name="composer_photo[]" display="inline" role=

CSS selector for reCaptcha checkbok using Selenium and vba excel

随声附和 提交于 2021-02-02 09:54:44
问题 In the website I am trying to fill some fields, there is a checkbok that I need to click to add the check mark in it <div class="rc-anchor-content"><div class="rc-inline-block"><div class="rc-anchor-center-container"><div class="rc-anchor-center-item rc-anchor-checkbox-holder"><span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox recaptcha-checkbox-expired" role="checkbox" aria-checked="false" id="recaptcha-anchor" dir="ltr" aria-labelledby=

Automating jQuery based bootstrap dropdown using Selenium and Java

三世轮回 提交于 2021-02-02 09:38:30
问题 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")){