selenium-webdriver

How to Change a html line code with python

为君一笑 提交于 2021-02-13 17:29:53
问题 I'd like to change this line: <button _ngcontent-c19="" class="blue-button-disabled" disabled="">CONTINUE </button> to this: <button _ngcontent-c19="" class="blue-button">CONTINUE </button> all that I could do is change the class name from blue-button-disabled to blue-button, but I couldn't remove disabled="" I used this code to achieve that result: driver.execute_script("arguments[0].setAttribute('class','blue-button')", element) 回答1: To remove the attribute disabled="" you can use the

selenium.common.exceptions.TimeoutException while invoking .click() on an element through expected_conditions

荒凉一梦 提交于 2021-02-13 05:45:19
问题 Using python, chromedriver and Windows. I've working on a script for some months which uses .click() function regularly, few days ago it stopped working anywhere on the site. I've been trying to locate the element by id, xpath, etc... or even click it by send_keys(Keys.ENTER) with no success. I'm just trying to click the login icon but nothing happens. Seems to find the element and even click it, but nothing happens. This is the site and here the code: browser = webdriver.Chrome(chrome

selenium.common.exceptions.TimeoutException while invoking .click() on an element through expected_conditions

☆樱花仙子☆ 提交于 2021-02-13 05:43:47
问题 Using python, chromedriver and Windows. I've working on a script for some months which uses .click() function regularly, few days ago it stopped working anywhere on the site. I've been trying to locate the element by id, xpath, etc... or even click it by send_keys(Keys.ENTER) with no success. I'm just trying to click the login icon but nothing happens. Seems to find the element and even click it, but nothing happens. This is the site and here the code: browser = webdriver.Chrome(chrome

Python Selenium Loop Through Table Elements

谁说胖子不能爱 提交于 2021-02-11 15:37:26
问题 I know there are similar questions out there. I have read many (if not all) of them and am still lost. I'm writing a script to automate some data retrival/entry and need to iterate over an unknown number of entries in a table on a web page. I created a sample you can see here: So far my script logs into this ERP system, navigates to the page in the screenshot, and then waits for the StandardGrid to load with this: WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/

Python Selenium Loop Through Table Elements

不打扰是莪最后的温柔 提交于 2021-02-11 15:36:34
问题 I know there are similar questions out there. I have read many (if not all) of them and am still lost. I'm writing a script to automate some data retrival/entry and need to iterate over an unknown number of entries in a table on a web page. I created a sample you can see here: So far my script logs into this ERP system, navigates to the page in the screenshot, and then waits for the StandardGrid to load with this: WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/

How to double click an element on Selenium Webdriver using JavaScript for Safari

半城伤御伤魂 提交于 2021-02-11 15:35:59
问题 I'm facing a problem double clicking an element on Safari using Java / Webdriver 2.48. The tests are working fine on IE, Chrome, and Firefox but Actions are not supported on Safari. Currently I'm doing something like this executor.executeScript("arguments[0].dblclick();", element); or executor.executeScript("arguments[0].dblclick;", element); but is not working. Here is the error arguments[0].dblclick is not a function. (In 'arguments[0].dblclick()', 'arguments[0].dblclick' is undefined)

How to double click an element on Selenium Webdriver using JavaScript for Safari

大兔子大兔子 提交于 2021-02-11 15:34:38
问题 I'm facing a problem double clicking an element on Safari using Java / Webdriver 2.48. The tests are working fine on IE, Chrome, and Firefox but Actions are not supported on Safari. Currently I'm doing something like this executor.executeScript("arguments[0].dblclick();", element); or executor.executeScript("arguments[0].dblclick;", element); but is not working. Here is the error arguments[0].dblclick is not a function. (In 'arguments[0].dblclick()', 'arguments[0].dblclick' is undefined)

Selenium is not properly determining if a page has a <title> html tag

佐手、 提交于 2021-02-11 15:08:45
问题 I'm trying to get Selenium to wait until the title tag of a web page is present when loading with Python. I've tried testing this code with other types of HTML tags and only the <body> tag didn't result in an error. wait = WebDriverWait(driver, 10) driver.get(link) wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'div'))) I expected the code to evaluate to completion but I got the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib

How can check the state (ON or OFF) of toggle button in selenium?

≡放荡痞女 提交于 2021-02-11 14:56:32
问题 I want to validate the state of toggle button, whether it is ON or OFF? I tried a lot but the one thing which is very strange is that, HTML is not getting changed in both the state. <div class="c-form-section"> <div class="o-grid"> <div class="o-grid__col o-grid__col--1-of-1"> <div class="o-grid__col o-grid__col--1-of-1 o-grid__col-tb--1-of-2"> </div> <div class="o-grid__col o-grid__col--1-of-1 o-grid__col-tb--1-of-2 o-grid__col--spaced-tb"> <div class="u-spaced-top--quarter-square"> <section

Webscraping: ElementNotInteractableException while trying to fill the form on this website

天大地大妈咪最大 提交于 2021-02-11 14:50:45
问题 I have been trying to scrape data from this site. I need to fill Get the precise price of your car form ie. the year, make, model etc.. I have written the following code till now: import requests import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait, Select from selenium.common.exceptions import NoSuchElementException from selenium.common