selenium-webdriver

How to switch between iframes using Selenium and Python?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-04 08:28:49
问题 I'm trying to make a script to checkout on a Shopify site and I was able to find the iframe for the card number, but was not able to find the iframe for the name on the card (2nd iframe). Is there any way to enter in a value for that iframe? driver.switch_to.frame(driver.find_element_by_tag_name("iframe")) driver.find_element_by_xpath('//input[@autocomplete="cc-number"]').send_keys("1234") driver.find_element_by_xpath('//div[@data-card-field-placeholder="Name on card"]').click() driver.switch

How to solve a StaleElementReferenceException: Message: stale element reference: element is not attached error using Selenium Ubuntu EC2 using Python

余生颓废 提交于 2021-02-04 08:27:30
问题 I am trying to extract all data of column "Nb B" in this page : https://www.coteur.com/cotes-foot.php When I run my code from a Ubuntu PC It works perfectly but when I tried with EC2 Ubuntu It does not give me the good return. Here is my server : ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611 (ami-0a63f96e85105c6d3) Here is the python script : #!/usr/bin/python3 # -*- coding: utf­-8 ­-*- from selenium import webdriver from selenium.webdriver.chrome.options import Options

Send whatsapp message to contacts using Python but getting an error: InvalidSelectorException: Message: invalid selector: Unable to locate an element

穿精又带淫゛_ 提交于 2021-02-04 08:25:07
问题 I am trying to send whatsapp message to contacts using Python but getting an error: InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[@title = "Me Postpaid"]"} (Session info: chrome=73.0.3683.103) (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 SP1 x86_64) I have used selenium for this and the code is mentioned below: from selenium import webdriver driver = webdriver

Send whatsapp message to contacts using Python but getting an error: InvalidSelectorException: Message: invalid selector: Unable to locate an element

前提是你 提交于 2021-02-04 08:25:07
问题 I am trying to send whatsapp message to contacts using Python but getting an error: InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[@title = "Me Postpaid"]"} (Session info: chrome=73.0.3683.103) (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 SP1 x86_64) I have used selenium for this and the code is mentioned below: from selenium import webdriver driver = webdriver

How to wait until all loaders disappears using Selenium WebDriver through Java

旧巷老猫 提交于 2021-02-04 08:18:22
问题 I am using selenium web driver and I need to wait until all loaders disappear. I have 12 widgets on dashboard page and I need to wait until all widgets are loaded. Loader shows on each widget. I have used both following ways but nothing works and no errors, it just passes on to next statement. new WebDriverWait(driver,60) .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[contains(text(),'Loader')]"))); WebDriverWait wait2 = new WebDriverWait(driver,60); wait2.until

Python Selenium SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[contains(@class, 'product-card__subtitle')

蹲街弑〆低调 提交于 2021-02-04 08:10:56
问题 Trying to get the XPath of div class and the text inside of the div. the two divs are: <div class="product-card__subtitle">Women's Shoe</div> <div class="product-card__subtitle">Men's Shoe</div> My Xpaths that are giving the selenium error are: driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text(" ")='Women's Shoe']") driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text()='Men's " "Shoe']") I am trying to get the path for

Python Selenium SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[contains(@class, 'product-card__subtitle')

帅比萌擦擦* 提交于 2021-02-04 08:09:32
问题 Trying to get the XPath of div class and the text inside of the div. the two divs are: <div class="product-card__subtitle">Women's Shoe</div> <div class="product-card__subtitle">Men's Shoe</div> My Xpaths that are giving the selenium error are: driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text(" ")='Women's Shoe']") driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text()='Men's " "Shoe']") I am trying to get the path for

WebDriverException: Message: unknown error: no chrome binary at C:/…/Chrome/Application/chrome.exe with ChromeDriver Selenium and Python

最后都变了- 提交于 2021-02-04 07:54:35
问题 Bit of a Python newbie here... Windows 7 x64 and Python 3.7 I have installed Selenium and the Chrome Webdriver. I'm using: from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.binary_location = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe' driver = webdriver.Chrome(chrome_options=options, executable_path='C:/python/chromedriver.exe') driver.get('http://google.com/') I'm getting: \python\python.exe C:/py/defectURLS/app

How to open the option items of a select tag (dropdown) in different tabs/windows?

北战南征 提交于 2021-02-04 07:09:06
问题 I'm trying to scrape this website using Python and Selenium, it requires you to select a date from drop-down box then click search to view the planning applications. URL: https://services.wiltshire.gov.uk/PlanningGIS/LLPG/WeeklyList. I have the code working to select the first index of the drop-down box and press search. How would I open multiple windows for all the date options in the drop-down box or go through them one by one so I can scrape it? from selenium import webdriver from selenium

How to open the option items of a select tag (dropdown) in different tabs/windows?

心已入冬 提交于 2021-02-04 07:08:30
问题 I'm trying to scrape this website using Python and Selenium, it requires you to select a date from drop-down box then click search to view the planning applications. URL: https://services.wiltshire.gov.uk/PlanningGIS/LLPG/WeeklyList. I have the code working to select the first index of the drop-down box and press search. How would I open multiple windows for all the date options in the drop-down box or go through them one by one so I can scrape it? from selenium import webdriver from selenium