webdriverwait

How do I get Selenium to login to the website Costco.com

雨燕双飞 提交于 2019-12-02 09:05:22
Picture of the screen it stays on forever: I am having trouble getting Selenium to login to Costco.com. It basically freezes at the login screen and won't proceed to the next screen. from selenium import webdriver; from selenium.webdriver.support.ui import Select; from selenium.webdriver.common.keys import Keys; from selenium.webdriver.common.by import By; import time; browser = webdriver.Chrome() browser.get('https://www.costcobusinessdelivery.com/LogonForm?URL=%2f') email = browser.find_element_by_css_selector('#logonId') email.click() email.send_keys('my_email') password = browser.find

How to extract the title and href attributes from the questions on reddit.com search page using Selenium Python

我怕爱的太早我们不能终老 提交于 2019-12-02 09:00:53
I want to scrape the link and title of all the questions on the page https://www.reddit.com/search?q=Expiration&type=link&sort=new . An element has the following structure: <a data-click-id="body" class="SQnoC3ObvgnGjWt90zD9Z" href="/r/excel/comments/ayiahc/calculating_expiration_dates_previous_solution_no/"> <h2 class="s1okktje-0 cDxKta"> <span style="font-weight:normal">Calculating Expiration Dates - Previous Solution No Longer Works</span> </h2> </a> I use questions = driver.find_elements_by_xpath('//a[@data-click-id="body"]') to get the questions then iterate them by for . And I coud use

Clicking “More” button via selenium

依然范特西╮ 提交于 2019-12-02 08:56:32
I am trying to scrape the following website : https://angel.co/companies There is a "More" button at the bottom, which on click loads more records. I need to click the button via selenium. I tried the following: python_button = driver.find_elements_by_class_name("more") python_button.click() However its not finding the appropriate button, i.e. my python_button returns an empty list. I tried the following: python_button = driver.find_element_by_class_name("more") And this gives the following error: Message: no such element: Unable to locate element: {"method":"class name","selector":"more"} Any

How to click on the first auto suggestion or first searched value on https://www.airdna.co/

泄露秘密 提交于 2019-12-02 08:54:40
问题 I'm trying to scrape the data from the website https://www.airdna.co i want to get the value of the first suggestion i managed the following code; The problem was i can't click on the first city to get the information can someone has a suggestion to solve this probleme #!/usr/bin/python # -*- coding: utf-8 -*- import re import time import csv import unittest import sys import datetime import os.path import pandas as pd from datetime import datetime from selenium import webdriver from bs4

How to print the href attributes using beautifulsoup while automating through selenium?

一曲冷凌霜 提交于 2019-12-02 08:33:31
Blue element's href value is what i want to access from this HTML I tried few ways to print the link but didn't work. My code below:- discover_page = BeautifulSoup(r.text, 'html.parser') finding_accounts = discover_page.find_all("a", class_="author track") print(len(finding_accounts)) finding_accounts = discover_page.find_all('a[class="author track"]') print(len(finding_accounts)) accounts = discover_page.select('a', {'class': 'author track'})['href'] print(len(accounts)) Output:- 0 0 TypeError: 'dict' object is not callable URL of the webpage is https://society6.com/discover but URL changes

Scrape website with dynamic mouseover event

与世无争的帅哥 提交于 2019-12-02 08:25:38
I am trying to scrape data which is generated dynamically from mouseover events. I want to capture the information from the Hash Rate Distribution chart from https://slushpool.com/stats/?c=btc which is generated when you scroll over each circle. The code below gets the html data from the website, and returns the table which is filled once the mouse passes over a circle. However, I have not been able to figure out how to trigger the mouseover event for each circle to fill the table. from lxml import etree from xml.etree import ElementTree from selenium import webdriver driver_path = "#Firefox

Java Wrapper method for waiting for element to be available for Apache Cordova Webview driven App

ⅰ亾dé卋堺 提交于 2019-12-02 07:55:29
问题 For Multiple Webview based Mobile App (iOS app built using Cordova, PhoneGap, XCode), I have created below method to check if element is present. Kindly suggest if below snippet makes sense? as traditional wrapper functions based on traditional Explicit waits are not working reliably. public boolean waitForElemToBeAvailable(final By by, final int timeout, int retries) { WebDriverWait wait = new WebDriverWait(appiumDriver, timeout); boolean success = false; final long waitSlice = timeout

How to scroll UP to an element and click in selenium?

断了今生、忘了曾经 提交于 2019-12-02 07:44:11
I have a scenario where system needs to scroll UP to the webelement in the left panel of the page and click to perform other operations.I have tried the below ways but none of them are working.Please suggest : 1. WebElement element = driver.findElement(By.xpath("element")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); Thread.sleep(500); 2. WebElement element = driver.findElement(By.xpath("element")); Actions actions = new Actions(driver); actions.moveToElement(ele); actions.perform(); Up or Down to scrollIntoView() an element you have to induce

Java Wrapper method for waiting for element to be available for Apache Cordova Webview driven App

别说谁变了你拦得住时间么 提交于 2019-12-02 06:39:37
For Multiple Webview based Mobile App (iOS app built using Cordova, PhoneGap, XCode), I have created below method to check if element is present. Kindly suggest if below snippet makes sense? as traditional wrapper functions based on traditional Explicit waits are not working reliably. public boolean waitForElemToBeAvailable(final By by, final int timeout, int retries) { WebDriverWait wait = new WebDriverWait(appiumDriver, timeout); boolean success = false; final long waitSlice = timeout/retries; if(retries>0){ List<WebElement> elements = appiumDriver.findElements(by); if(elements.size()>0){

How to increase the execution speed through Selenium and Webdriver

旧时模样 提交于 2019-12-02 05:26:27
问题 Test is very slow during execution of the script without knowing the reason. This is my script : driver.Navigate().GoToUrl(url); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.LinkText("Register Here")).Click(); new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until( SeleniumExtras.WaitHelpers.ExpectedConditions.InvisibilityOfElementLocated( (By.XPath("//div[@class='loader-wrapper ng-trigger ng-trigger-visibilityChanged ng-animating']")))); driver