selenium-webdriver

Selenium: “Failed to Decode Response from Marionette”

允我心安 提交于 2021-02-10 20:50:40
问题 I've seen this issue around, but, unfortunately, I have struggled to find a definite resolution. Perhaps, if someone has it working for themselves, they could share what firefox and geckodriver combination they have it working with. Edit: I am running this through Jenkins, so maybe there is an embedded firefox in Jenkins that this is using, which differs from that on the server, itself. For myself, I am using: Centos 7 Mozilla Firefox 67.0 GeckoDriver version 0.26.0 (for linux64; downloaded

Selenium: “Failed to Decode Response from Marionette”

强颜欢笑 提交于 2021-02-10 20:31:10
问题 I've seen this issue around, but, unfortunately, I have struggled to find a definite resolution. Perhaps, if someone has it working for themselves, they could share what firefox and geckodriver combination they have it working with. Edit: I am running this through Jenkins, so maybe there is an embedded firefox in Jenkins that this is using, which differs from that on the server, itself. For myself, I am using: Centos 7 Mozilla Firefox 67.0 GeckoDriver version 0.26.0 (for linux64; downloaded

chromedriver.exe runs ~8 chrome.exe instances

懵懂的女人 提交于 2021-02-10 20:28:29
问题 I write UI automation tests using Selenium. And I noticed that when I create an instance of chromedriver.exe -> ~8 chrome.exe processes appear in the Task Manager. Task Manager screenshot when running 1 test: So, when I run in parallel, let's say, 8 tests there are a lot of chrome.exe instances in the Task Manager that use some ports and load a CPU and a memory. Does it work by design? Why so much chrome.exe instances are needed for one chromedriver.exe? Is this configurable? In my code, I

How to get the price as a number from a website using Selenium and Python

眉间皱痕 提交于 2021-02-10 18:02:51
问题 I am creating a bot that would automate my work and copy particular values from a particular website. Everything works fine but the last lines of my code that says w.text produces an outcome which is text and I need a number. Each element that I need the value of looks like this after inspection: <span class="good">€25,217.65</span> How do I get the value as a number instead of as a text? I tried w.value or w.get_attribute('value) but it doesn't work. Here is my program (excluding downloads

Python selenium xpath geting text is empty

痴心易碎 提交于 2021-02-10 17:48:45
问题 So I have this link and I'm trying to obtain the text from this XPath //div[@class='titlu'] but for some reason sometimes I'm getting the text how it should be and other times I'm receiving an empty string even though the site is containing that text. What have I tried: wait = WebDriverWait(self.driver, 10) wait.until(EC.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Ap. de lux 3 "))) e = self.driver.find_element_by_xpath(html_data.xpath) also: wait = WebDriverWait(self.driver, 10) wait

How to download XML files avoiding the popup This type of file may harm your computer through ChromeDriver and Chrome using Selenium in Python

别来无恙 提交于 2021-02-10 15:36:39
问题 I want to download a daily xml file from a supplier. I managed to login and click the link Accept Download to start the downloading using chromedriver. But I get the popup "This type of file may harm your computer". The MIME of the page is text/html, I am not sure if link is text/javascript I tried all suggested solutions with options like print('Starting..') prefs = { 'download.default_directory': 'C:\\Users\MainDesk\Downloads', 'download.prompt_for_download': False, 'download.extensions_to

How to download XML files avoiding the popup This type of file may harm your computer through ChromeDriver and Chrome using Selenium in Python

情到浓时终转凉″ 提交于 2021-02-10 15:36:04
问题 I want to download a daily xml file from a supplier. I managed to login and click the link Accept Download to start the downloading using chromedriver. But I get the popup "This type of file may harm your computer". The MIME of the page is text/html, I am not sure if link is text/javascript I tried all suggested solutions with options like print('Starting..') prefs = { 'download.default_directory': 'C:\\Users\MainDesk\Downloads', 'download.prompt_for_download': False, 'download.extensions_to

How to close the Modal using Selenium WebDriver?

我的梦境 提交于 2021-02-10 14:19:29
问题 I have a dropdown list, when I click on any of the dropdown value then a modal get opens, When I click outside the modal, it will get close. How to handle it with Selenium WebDriver? here is my Modal Code <div class="modal fade bd-example-modal-sm show" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" style="display: block;"> <div class="modal-dialog modal-sm"> <div class="modal-content">You click on Dropdown hover Option </div> </div> I have tried with below code driver

Selenium Python - Get Network response body

泪湿孤枕 提交于 2021-02-10 14:17:09
问题 I use Selenium to react to the reception of data following a GET request from a website. The API called by the website is not public, so if I use the URL of the request to retrieve the data, I get {"message":"Unauthenticated."} . All I've managed to do so far is to retrieve the header of the response. I found here that using driver.execute_cdp_cmd('Network.getResponseBody', {...}) might be a solution to my problem. Here is a sample of my code: import json from selenium import webdriver from

Selenium Python - Get Network response body

走远了吗. 提交于 2021-02-10 14:15:44
问题 I use Selenium to react to the reception of data following a GET request from a website. The API called by the website is not public, so if I use the URL of the request to retrieve the data, I get {"message":"Unauthenticated."} . All I've managed to do so far is to retrieve the header of the response. I found here that using driver.execute_cdp_cmd('Network.getResponseBody', {...}) might be a solution to my problem. Here is a sample of my code: import json from selenium import webdriver from