selenium

Scroll to the end of the infinite loading page using selenium Python

不想你离开。 提交于 2021-01-28 08:12:02
问题 I'm scraping the follower names from the twitter using Selenium and that page is infinite, whenever I scroll down I can see new followers. Somehow I want to go to the bottom of the page so that I can scrap all the followers. while number != 5: driver.execute_script("window.scrollTo(0,document.body.scrollHeight)") number = number + 1 time.sleep(5) usernames = driver.find_elements_by_class_name( "css-4rbku5.css-18t94o4.css-1dbjc4n.r-1loqt21.r-1wbh5a2.r-dnmrzs.r-1ny4l3l") for username in

How to send text to the recovery mail field of https://mail.protonmail.com/create/new?language=en using Selenium and Python

别来无恙 提交于 2021-01-28 08:02:25
问题 So im trying to get my first ProtonMail Account Generator working. My Problem is that selenium wont find either the field for the recovery mail or the Create Account button. I switched to the iframe already. Im pretty new and thought that this problem might be caused by the "new" html document which contains the bottom part (starting with the recovery email). Hope someone can help me. Screenshot from selenium import webdriver import time url = 'https://mail.protonmail.com/create/new?language

Force keyboard layout for Selenium2 sendkeys method

北城余情 提交于 2021-01-28 08:01:27
问题 Is it somehow possible to force Selenium2 webdriver sendkeys method to use specific keyboard layout instead of Windows active one in specific testcase? The issue I ran into is that my default keyboard layout is "Latvian (apostrophe)" (where apostrophe is pressed before accented letters) and webdriver.findElement(By.name("lastName")).sendKeys("O'Neill"); is actually entered as "OŅeill" in the field. P.S. Couldn't find one, but maybe there's some Selenium2 webdriver method for setting field

I need help finding an element with a locator

不想你离开。 提交于 2021-01-28 07:43:12
问题 I'm trying to get the elements from this xpath here is the code, there is several of these elements I cut the code down to avoid a million lines on here. html <keyword-text class="_nghost-fyp-81"><div class="keyword-text _ngcontent- fyp-81" clickabletooltiptarget="" aria-label=""><span class="keyword _ngcontent-fyp-81" aria-hidden="false">new york new york las vegas</span> <!----></div><!----><!----></keyword-text> xpath keyword_text = self.browser.find_elements_by_xpath("//span[starts-with(

Trying to select an option from the dropdown in Selenium web automation -error- “ElementNotInteractableException: could not be scrolled into view”

做~自己de王妃 提交于 2021-01-28 07:37:30
问题 package com.web.automation; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng

Appium Send keys() function sending Chinese characters as part of English strings

半城伤御伤魂 提交于 2021-01-28 07:32:20
问题 while using appium send keys() function to send the name in text field,in addition to name some random chinese characters appear in the text field. we used in capability capabilities.setCapability("unicodeKeyboard", "true"); even thought we could not solve the error public ProfilePage click_On_Edit_Profile_Icon(String Name, String Email,String Alt_Mobile )throws Exception { Thread.sleep(5000); driver.findElementByXPath("//android.widget.EditText[contains(@resource-id,'etFlat')"].click();

Selenium page_source truncated

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 07:30:41
问题 I would like to have the source code of this page for example : https://paris-sportifs.pmu.fr/event/699032 Below is my code snippet: opts = Options() opts.add_argument("Host=[paris-sportifs.pmu.fr]") capabilities = DesiredCapabilities.FIREFOX capabilities["marionette"] = True browser = webdriver.Firefox(options=opts, capabilities=capabilities) browser.get(event_url) time.sleep(3) div_list = browser.find_elements_by_class_name('table--header--inner.collapsed') for item in div_list: browser

DeprecationWarning: use options instead of chrome_options error using Brave Browser With Python Selenium and Chromedriver on Windows

梦想与她 提交于 2021-01-28 07:11:46
问题 I want to use Selenium (installed: ver 3.141.0.dist-info) on Python (3.8) which is installed on my Windows 7 64, I Use Brave Browser Version 1.17.73 Chromium: 87.0.4280.67 (Official Build) (64-bit) and Chromedriver (chromedriver_win32-87.0.4280.20) for it, when running the following Py file which I got the code from here, new Brave browser opens up, but I get errors. Any solution to make this works? Appreciate your help. when running this file: from selenium import webdriver driver_path = 'C:

org.openqa.selenium.NoSuchElementException

泪湿孤枕 提交于 2021-01-28 06:31:34
问题 I am trying to import login credential like: username and password using xsl sheet, by using below code but I got NoSuchElementException exception while running, my xsl sheet looks like: username | password -------------------------- jan30selenium | selenium am using: eclipse webdriver.iostream selenium tool Login.java: package Iostream; import java.io.FileInputStream; import jxl.Sheet; import jxl.Workbook; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa

Python Selenium Set Multiple Chrome Preference

荒凉一梦 提交于 2021-01-28 06:25:25
问题 I am trying to set multiple chrome options in my chrome browser. This is what I currently have: prefs = {"download.default_directory" : "Download/Path"} moreprefs = {'safebrowsing.enabled': 'false'} chromeOptions = webdriver.ChromeOptions() chromeOptions.add_experimental_option("prefs", prefs) chromeOptions.add_experimental_option("prefs", moreprefs) self.driver = webdriver.Chrome(chrome_options=chromeOptions) The probblem is it only takes in to account the 1 of the chromeOptions.add