selenium-webdriver

Invalid port. Exiting..Exception in thread “main” org.openqa.selenium.WebDriverException: Driver server process died prematurely ChromeDriver Selenium

巧了我就是萌 提交于 2020-08-10 13:00:41
问题 Installation details I have installed java version : 1.8 selenium jar version : 3.141.59, chrome browser version : 84.0.4147.89. I want to launch the google in chrome browser using selenium web-driver test case. But I am not able to launch due the above attached issue. Please help me to fix the issue. 回答1: You need to update your exe version https://chromedriver.chromium.org/downloads in this link you can download driver exe and set in path Can you kill chrome exe and refresh and rerun ( note

How to pass the value in search on url https://www.virustotal.com/gui/home/search using Selenium and Python

拥有回忆 提交于 2020-08-10 05:31:11
问题 driver.get("https://www.virustotal.com/gui/home/search") sbox = driver.find_element_by_id("searchInput") sbox.send_keys("129.226.130.245") sbox.send_keys(Keys.ENTER) Please suggest, on how to pass values to search box 回答1: From what I can see, the element you are trying to search is not an input element. You would be interested in INPUT tag, rather than some div . So you need to be more specific, something like driver.findElement( By.xpath( "//div[@id='searchInput']//input" ) ) This syntax

How to wait until dropdown selected text matches other text using selenium?

时光毁灭记忆、已成空白 提交于 2020-08-09 14:03:36
问题 HTML: <select name="ddlFruit" id="ddlFruit" class="Searchddl"> <option value="">Select</option> <option value="447">Grapes</option> <option value="448">Mango</option> <option selected="selected" value="449">Apple</option> </select> Suppose "Apple" is in first selected mode, due to some other actions on site, this drop-down changes to other options automatically. I want webdriver to wait until "Mango" text is in selected mode. Tried code: public static SelectElement

How do you use EC.presence_of_element_located((By.ID, “myDynamicElement”)) except to specify class not ID

落花浮王杯 提交于 2020-08-08 06:41:33
问题 I am trying to use Python to web scrape a website that loads it's HTML dynamically by using embedded javascript files that render the data as a Response into the HTML. Therefore, if I use BeautifulSoup alone, I will not be able to retrieve that data that I need as my program will scrape it before the Javascript loads the data. Due to this, I am integrating the selenium library into my code, to make my program wait until a certain element is found before it scrapes the website. I had

WebDriverManager take incorrect version of driver in selenium

柔情痞子 提交于 2020-08-08 05:32:32
问题 I am trying to run the selenium script through the docker which is installing the chrome browser using following command: RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome \ && echo "#!/bin/bash\nexec /opt/google/chrome/google-chrome.real --no-sandbox --disable-setuid-sandbox \"\$@\"" > /opt/google/chrome/google-chrome \ && chmod 755 /opt/google/chrome/google-chrome the above command is installing the chrome browser version 84:

Cant find root elements with RemoteWebDriver.FindElementsByXPath(“/”);

梦想的初衷 提交于 2020-08-08 03:58:32
问题 When I try to use var element = webdriver.FindElementByXPath("/"); or var elements = webdriver.FindElementsByXPath("/"); I expect to get the root element(s) of my document. What I get instead is an InvalidSelectorException with this message. "invalid selector: The result of the xpath expression "/" is: [object HTMLDocument]. It should be an element. (Session info: chrome=50.0.2661.102) (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0

How to fix 403 response when using HttpURLConnection in Selenium since the links are opening manually without any issue

六眼飞鱼酱① 提交于 2020-08-06 03:21:50
问题 I was checking the active links in a website with selenium web driver and java. I have passed the links to the array and while verifying I am getting the response as 403 forbidden for all links in the site. It is just a public website anyone can access. The links are working properly when clicking manually. I wanted to know Why it is not showing 200 and what can be done on this situation. This is for Selenium webdriver with Java for(int j=0;j< activelinks.size();j++) { System.out.println(

Extracting text from a website using selenium

风流意气都作罢 提交于 2020-08-05 10:11:26
问题 trying to find a way to extract the book's summary from the good reads page. Have tried Beautiful soup / Selenium, unfortunately to no avail. link:https://www.goodreads.com/book/show/67896.Tao_Te_Ching?from_search=true&from_srp=true&qid=D19iQu7KWI&rank=1 code: from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected

Selenium + Python how to listen for change of element

若如初见. 提交于 2020-08-05 06:29:52
问题 The idea is to create a bot to read message from a chat, and all message are in a ul>li (not neccesary to write message), e.g <ul class="message-list"> <li class="message"> Hello There </li> <li class="message"> Hello </li> </ul> I found expected_conditions from Selenium, to handle if element exist/found, but it's always true, because there is a message but I don't want to continue the code if a message was already in chat, that's not the main idea. And after that, I found

How to scroll down in dropdown window in selenium webdriver?

泪湿孤枕 提交于 2020-08-05 04:36:08
问题 <div id="boundlist-1277-listWrap" data-ref="listWrap" role="presentation" class="x-boundlist-list-ct x-unselectable x-no-touch-scroll x-scroll-container" style="overflow: auto; height: 298px;"> <ul id="boundlist-1277-listEl" data-ref="listEl" class="x-list-plain x-scroll-scroller"> <li role="option" unselectable="on" class="x-boundlist-item" tabindex="-1" data-recordindex="0" data-recordid="99400" data-boundview="boundlist-1280">Assessment Completion - Returned To Functional Validation</li>