selenium-webdriver

Get link from attribute in actual row in selenium Python

你。 提交于 2020-08-20 10:34:19
问题 I fetch the data from the web-table but the link was not an actual row attribute link. It was a 2 rows before the attribute link. Here is my code: stack = driver.find_elements_by_xpath(".//span[@data-bind = 'text: $salableQuantityData.qty']") quant = driver.find_elements_by_xpath("//*[@class='admin__data-grid-wrap']/table/tbody/tr/td[7]/div") link = driver.find_elements_by_xpath("//*[@class='admin__data-grid-wrap']/table/tbody/tr/td[15]/a") #looping all 3 variables for stuck,quantity,links in

Window keeps closing after running selenium

北城余情 提交于 2020-08-20 07:49:11
问题 Everytime I run this code the window opens blank and then loads the required page for about 1 second before closing. from selenium import webdriver driver = webdriver.Chrome('C:/Users/*****/Downloads/chromedriver_win32/chromedriver.exe') driver.get("https://stackoverflow.com/") An error has come up once or twice saying [268:10204:0208/163438.782:ERROR:broker_win.cc(55)] Error reading broker pipe: The pipe has been ended. (0x6D) but it only appears sometimes even though the code hasn't changed

Can't start Tor with Python, Selenium: Tor failed to start [duplicate]

旧时模样 提交于 2020-08-20 07:13:07
问题 This question already has answers here : How to initiate a Tor Browser 9.5 which uses the default Firefox to 68.9.0esr using GeckoDriver and Selenium through Python (1 answer) How to connect to Tor browser using Python (1 answer) Closed 21 days ago . The program should open Tor with selenium, but when i start it, it has an error: Traceback (most recent call last): File "c:/Users/Seya Fässler/Desktop/Python/test4.py", line 11, in <module> driver = webdriver.Firefox(firefox_binary=binary,

selenium.common.exceptions.WebDriverException: Message: unknown error: 'script' must be a string while using execute_script() through Selenium Python

房东的猫 提交于 2020-08-20 06:48:07
问题 I've got an issue with browser.execute_script while using selenium with python. There is an element that i'd like to click (it's xpath below) "//*[@id='listFav_FI410_23244709400000_FAGNNURROR_IPOF_APP_P43070_W43070A_CP000A001_40']/table/tbody/tr/td[1]" I try to do it with: navMenu = browser.find_element_by_xpath("//*[@id='listFav_FI410_23244709400000_FAGNNURROR_IPOF_APP_P43070_W43070A_CP000A001_40']/table/tbody/tr/td[1]") time.sleep(3) browser.execute_script(navMenu.click()) And it works (So

Python 3.5 - Selenium - How to handle a new window and wait until it is fully loaded?

女生的网名这么多〃 提交于 2020-08-19 17:54:00
问题 I am doing browser automation and I am blocked at a certain point: at a moment, I ask the browser to click on a button, which in turn open up a new window. But sometimes the Internet is too slow, and so this new window takes time to load. I want to know how can I ask Selenium to wait until this new fresh window is fully loaded. Here's my code: driver.switch_to.default_content() Button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, 'addPicturesBtn'))) Button.click()

Python 3.5 - Selenium - How to handle a new window and wait until it is fully loaded?

偶尔善良 提交于 2020-08-19 17:52:17
问题 I am doing browser automation and I am blocked at a certain point: at a moment, I ask the browser to click on a button, which in turn open up a new window. But sometimes the Internet is too slow, and so this new window takes time to load. I want to know how can I ask Selenium to wait until this new fresh window is fully loaded. Here's my code: driver.switch_to.default_content() Button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, 'addPicturesBtn'))) Button.click()

selenium in python : NoSuchElementException: Message: no such element: Unable to locate element

强颜欢笑 提交于 2020-08-12 07:07:14
问题 I tried typing 'abc' in the first block of id and 'cdef' in the second block of password. However, the error code at the bottom comes up. from selenium import webdriver driver.get('http://sugang.korea.ac.kr') Added implicitly wait to prevent the code from executing before the page fully loads. driver.implicitly_wait(30) Code for adding username and password is as below driver.find_element_by_name('id').send_keys('abc') driver.find_element_by_name('pw').send_keys('cdef') But getting below

selenium in python : NoSuchElementException: Message: no such element: Unable to locate element

不问归期 提交于 2020-08-12 07:06:42
问题 I tried typing 'abc' in the first block of id and 'cdef' in the second block of password. However, the error code at the bottom comes up. from selenium import webdriver driver.get('http://sugang.korea.ac.kr') Added implicitly wait to prevent the code from executing before the page fully loads. driver.implicitly_wait(30) Code for adding username and password is as below driver.find_element_by_name('id').send_keys('abc') driver.find_element_by_name('pw').send_keys('cdef') But getting below

java.lang.ClassCastException: org.openqa.selenium.By$ById cannot be cast to org.openqa.selenium.WebElement

谁说胖子不能爱 提交于 2020-08-12 04:23:03
问题 I try make a automation test using Page Object with annotation By in selenium webdriver, but de Eclipse show-me the following message error: java.lang.ClassCastException: org.openqa.selenium.By$ById cannot be cast to org.openqa.selenium.WebElement Follow the code: Class: AcertoPerfilTratamentoOs public class AcertoPerfilTratamentoOs { static WebDriver driver; By cidade = By.id("cboCidade"); By tipoOcorrencia = By.id("txtTipoOcorrencia"); public AcertoPerfilTratamentoOs(WebDriver driver) {

java.lang.ClassCastException: org.openqa.selenium.By$ById cannot be cast to org.openqa.selenium.WebElement

浪子不回头ぞ 提交于 2020-08-12 04:21:29
问题 I try make a automation test using Page Object with annotation By in selenium webdriver, but de Eclipse show-me the following message error: java.lang.ClassCastException: org.openqa.selenium.By$ById cannot be cast to org.openqa.selenium.WebElement Follow the code: Class: AcertoPerfilTratamentoOs public class AcertoPerfilTratamentoOs { static WebDriver driver; By cidade = By.id("cboCidade"); By tipoOcorrencia = By.id("txtTipoOcorrencia"); public AcertoPerfilTratamentoOs(WebDriver driver) {