selenium

What is the return type of executeScript() method of JavascriptExecutor?

空扰寡人 提交于 2021-01-29 12:06:49
问题 If a JavaScript on a web page return non-decimal value then what will javascriptExecuter.executeScript() will return? Ccan anyone answer this question? 回答1: executeScript() executeScript() executes a JavaScript in the context of the currently selected frame or window. The script fragment provided will be executed as the body of an anonymous function. If the script has a return value (i.e. if the script contains a return statement), then the following type of objects are returned: For an HTML

Python Selenium Internet explorer not able to find css selector, or xpath

喜你入骨 提交于 2021-01-29 12:00:34
问题 So a little background on this, flask is being run through alwaysup, which keeps flask always up as a windows service. This whole process makes my selenium script start in a different instance not in the local VM. When it's running in that instance, it has the same internet settings and it navigates to the url without any problem. It gets stuck once it needs to start filling out the form, for example. driver.find_element_by_id('ctl00_PlaceHolderMain_CreatePerson_uoc_BasicInfo_grouping

Selenium findElements() returns the same instance of the first element multiple times

我怕爱的太早我们不能终老 提交于 2021-01-29 11:40:30
问题 I need to get the list of all article titles. But for some reason Selenium returns the same instance of the article WebElement 3 times. The web page HTML looks like this: <div id="content" class="site-content clearfix"> <div class="container clearfix"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <article id="post-403"> <h2 class="entry-title"> <i class="trusted-entry-icon"/> <a href="https://www.example.com/title-of-article-1/" rel="bookmark">Title

Selenium find Select and Input in Dialog Modal

风流意气都作罢 提交于 2021-01-29 11:38:10
问题 I want to create a Selenium Test where I choose a value from a select and I want to fill in a value into a input field. They are both inside of a modal div. How can I automate these two elements ? The Html Code of the Select is the following: The Html Code of the Input is the following: 来源: https://stackoverflow.com/questions/65421606/selenium-find-select-and-input-in-dialog-modal

Unresolved import selenium in python

好久不见. 提交于 2021-01-29 11:22:53
问题 I have just downloaded Visual Studio Code and tried to run some Python code. However, when I try to import Seleinum I receive the following error: from selenium import webdriver from selenium.webdriver.common.keys import Keys Erros: module selenium unresolved import 'selenium'Python(unresolved-import) unresolved import 'selenium.webdriver.common.keys' Python(unresolved-import) Any idea how to make it work? 回答1: The links below address the issue you are having. Your workspace settings are

Enabling HTTP Proxy with Auth Using Selenium and PHP WebDriver

风流意气都作罢 提交于 2021-01-29 11:08:44
问题 I am currently using Google Chrome 86.0.4240.75 with the relevant WebDriver for Selenium. I am trying to get it to work with an HTTP proxy with authorization, using the workaround provided here: https://github.com/RobinDev/Selenium-Chrome-HTTP-Private-Proxy This is my code for setting up the proxy: $this->options = new Chrome\ChromeOptions(); $zip = new \ZipArchive; $pluginForProxyLogin = __DIR__.'/../collectors/sel'.$instanceId.'.zip'; if (file_exists($pluginForProxyLogin)) unlink(

Selenium proxy server argument - unknown error: net::ERR_TUNNEL_CONNECTION_FAILED

柔情痞子 提交于 2021-01-29 11:02:16
问题 Hope you're well. I am facing a little problem when trying to set-up my chrome webdriver. I am trying to change the parameters of the webdriver to rotate the User Agent & the IP (I use it for scrapping purpose & don't want to get spot with the same IP & UA). When I pass the UA argument, everything works well. But when I add the IP argument, it systematically fails for some reasons that I can't identify. I always receive the following error WebDriverException: unknown error: net::ERR_TUNNEL

Cannot scrape website using Selenium in Python

帅比萌擦擦* 提交于 2021-01-29 10:57:27
问题 Trying to scrape off some data from footlocker.com for an academic project but I get an error when I try to open the page using Selenium: from selenium import webdriver driver = webdriver.Chrome("/Users/rushabhnahar/Downloads/chromedriver") driver.get("https://www.footlocker.com/adidas-Originals/Shoes/_-_/N- zrZrj?cm_REF=Shoes&crumbs=991") It opens up the browser and the respective page but gives an error saying 'We are sorry'. Any help will be appreciated. 来源: https://stackoverflow.com

How do I click on active day on date picker using selenium python?

醉酒当歌 提交于 2021-01-29 10:54:54
问题 So there are multiple calendars (datepickers) on the page and I have managed to click on the desired calendar. I want to click on the active date (current date). class="day active" How can I find this element after clicking on desired calendar glyphicon? P.S. when I copy selector for this- I am getting body > div:nth-child(27) > div.datepicker-days > table > tbody > tr:nth-child(4) > td.day.active And when I inspect element and search td.day.active, I am able to reach that element. So I have

Code Coverage for Cucumber Tests using Jacoco

妖精的绣舞 提交于 2021-01-29 10:52:17
问题 I am trying to integrate Jacoco to get the code coverage for my Cucumber tests using Maven. Following is my project structure: -src-main-java-Pages -src-main-java-Helper -src-test-java-resources-features -src-test-java-Steps Following is the Jacoco configuration in my POM.xml <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.2</version> <configuration> <destFile>${basedir}/target/coverage-reports/jacoco.exec</destFile> <dataFile>${basedir}/target