selenium-webdriver

selenium.common.exceptions.WebDriverException: Message: 'library' executable may have wrong permissions for ChromeDriver

一个人想着一个人 提交于 2021-02-04 05:55:33
问题 I want to use the chrome webdriver to connect to "https://www.google.com". below is the code. from selenium import webdriver import time driver = webdriver.Chrome("C:\\Users\\faisal\\library") driver.set_page_load_timeout(10) driver.get("https://www.google.com") driver.find_element_by_name("q").send_keys(" automation by name ") driver.find_element_by_name("blink").click() time.sleep(5) driver.close() When I run the test, the following error message is displayed.Its a permission problem C:

WebDriverError: no such session error using ChromeDriver Chrome through Selenium and Jasmine

别来无恙 提交于 2021-02-04 05:53:27
问题 I'm trying to make an automated test for my webpage and I'm using Jasmine in tandem with selenium. When testing on chrome (using chromedriver) I get, unpredictably, the error below. It happens frequently enough that when I run a test suite it hardly ever finishes. Ive found evidence of this bug but cant find a solid answer: https://bugs.chromium.org/p/chromedriver/issues/detail?id=732 (granted this was for chromium and I'm using chrome) WebDriverError: no such session (Driver info:

How to find button element with webdriver?

点点圈 提交于 2021-02-04 05:37:47
问题 I have the following code for a button : <div class="buttons"> <button class="btn dialog-confirm btn-primary" style="margin-left: 4px;">Confirm</button> <button class="btn dialog-cancel" style="margin-left: 4px;">Cancel</button> </div> There are two buttons on is Confirm and another is Cancel I can find the button with XPath but I don't want to use XPath. Is there another way to find the button element in this case? I tried this: driver.findElement(By.className("btn dialog-confirm btn-primary

System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation

人盡茶涼 提交于 2021-02-02 10:04:51
问题 I am trying to automate a reactjs application and the framework our project is using built on C# and protractor-net. After any click or assert function I get the following error, but the defined action in the code executes successfully. System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> OpenQA.Selenium.WebDriverTimeoutException : timeout What is the cause of this error? using NUnit.Framework; using OpenQA.Selenium; using OpenQA

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

Unable to send text to Email field on Microsoft login page using Selenium

我与影子孤独终老i 提交于 2021-02-02 09:45:09
问题 I'm trying to figure out a way to automatically log in / enter text into a given text field on a particular web page. I've already don't this before, but this particular page isn't responding to anything I've thrown at it yet. The default page load already has the auto-focus on the necessary text box. I'm currently using Python to write the Selenium code. My current script includes prior processes that lead to the page in question, where my current problem lies. Additionally, I've been

How to paginate through the page numbers when href contains javascript:__doPostBack()

别来无恙 提交于 2021-02-02 09:36:27
问题 I'm trying to scrape this website http://www.mfa.gov.tr/sub.ar.mfa?dcabec54-44b3-4aaa-a725-70d0caa8a0ae but when I want to go to next page I can't because the link doesn't change you will find that pages links are like that href="javascript:__doPostBack('sb$grd','Page$1')" I have a code that I tried but it only goes to page 2 and then gave me an error: tale element reference: element is not attached to the page document from selenium import webdriver url = 'http://www.mfa.gov.tr/sub.ar.mfa

How to paginate through the page numbers when href contains javascript:__doPostBack()

三世轮回 提交于 2021-02-02 09:35:34
问题 I'm trying to scrape this website http://www.mfa.gov.tr/sub.ar.mfa?dcabec54-44b3-4aaa-a725-70d0caa8a0ae but when I want to go to next page I can't because the link doesn't change you will find that pages links are like that href="javascript:__doPostBack('sb$grd','Page$1')" I have a code that I tried but it only goes to page 2 and then gave me an error: tale element reference: element is not attached to the page document from selenium import webdriver url = 'http://www.mfa.gov.tr/sub.ar.mfa

How to change the date of a hidden element of a Datepicker using setAttribute method and Selenium with Python?

杀马特。学长 韩版系。学妹 提交于 2021-02-02 09:25:28
问题 I have been struggling for days to find a way to set a date of a datepicker using Selenium with Python. I found out that there is a hidden element with the date, so I tried javascript executor to set a value to that hidden element. I tried different ways, and the scripts seem to execute fine, but the date doesn't change. My script looks like this: #input date by using hidden date method 1 element = browser.find_element_by_xpath("/html[1]/body[1]/div[1]/form[1]/table[1]/tbody[1]/tr[1]/td[1]