selenium

What are properties of find_element_by_class_name in selenium python?

与世无争的帅哥 提交于 2021-02-05 07:40:28
问题 browser = webdriver.Firefox() browser.get(url) divs = browser.find_elements_by_class_name('class') Are there any properties of browser.find_element_by_class_name('class')? For example if I have code like that: <div class="foo"> <a href="" class="poo">one</a> <a href="" class="poo">two</a> <a href="" class="poo">three</a> </div> <div class="foo"> <a href="" class="koo">one</a> <a href="" class="koo">two</a> <a href="" class="koo">three</a> </div> I want to get text from 'a' tags. But firstly I

How get the text from the <p> tag using XPath Selenium and Python

坚强是说给别人听的谎言 提交于 2021-02-05 07:39:16
问题 I need to catch with XPath one line from a text inside a <p> . I need to store the text Content-type: text/plain; charset=us-ascii into a variable in python but i get the next error: selenium.common.exceptions.WebDriverException: Message: TypeError: Expected an element or WindowProxy, got: [object Text] {} Here is the code im trying: import selenium.webdriver as webdriver browser = webdriver.Firefox() browser.get('https://www.w3.org/Protocols/rfc1341/7_1_Text.html') foo = browser.find_element

Driver info: driver.version: unknown with ChromeDriver Chrome using Selenium and Python

不羁的心 提交于 2021-02-05 07:37:09
问题 It is showing timed out for driver server to start when I use chrome driver. And when I try to use Firefox it is showing session unexpectedly exited. I am trying to run the Remote driver on a server using selenium in python what should I do? Unable to create new session. UnknownError: Timed out waiting for driver server to start. Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:22:52' System info: host: 'server.*******.com', ip: '61.16.155.6', os.name: 'Linux', os

Headless Chrome Driver not working for Selenium

核能气质少年 提交于 2021-02-05 07:27:06
问题 I am current having an issue with my scraper when I set options.add_argument("--headless") . However, it works perfectly fine when it is removed. Could anyone advise how I can achieve the same results with headless mode? Below is my python code: from seleniumwire import webdriver as wireDriver from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver

Mozilla Firefox 68.2.0esr browser is crashing using GeckoDriver and Selenium

我们两清 提交于 2021-02-05 07:19:25
问题 I was trying to launch Firefox browser through selenium, but unfortunately browser is getting closed immediately after it launches. I couldn't interpret from the log file. Here are the log file entries: 1582121786461 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.d4XupquDfaWC" 1582121787117 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid

Mozilla Firefox 68.2.0esr browser is crashing using GeckoDriver and Selenium

Deadly 提交于 2021-02-05 07:19:08
问题 I was trying to launch Firefox browser through selenium, but unfortunately browser is getting closed immediately after it launches. I couldn't interpret from the log file. Here are the log file entries: 1582121786461 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.d4XupquDfaWC" 1582121787117 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid

selenium.common.exceptions.WebDriverException: Message: 'firefox' executable needs to be in PATH with GeckoDriver Firefox Selenium and Python

馋奶兔 提交于 2021-02-05 07:19:05
问题 I am trying to open Firefox with selenium,i tried from selenium import webdriver driver=webdriver.Firefox() But i got the following error: selenium.common.exceptions.WebDriverException: Message: 'firefox' executable needs to be in PATH. Selenium using Python - Geckodriver executable needs to be in PATH I tried from selenium.webdriver.firefox.firefox_binary import FirefoxBinary binary = FirefoxBinary('/usr/bin/firefox') browser = webdriver.Firefox(firefox_binary=binary) Also tried from

How to validate Check box if xpaths are same in case of selected and unselected

╄→гoц情女王★ 提交于 2021-02-05 07:18:06
问题 M unable to validate checkbox, if it's selected or not because both the HTML are same I tried isSelected(), but it's not working Below is the HTML code for both selected and unselected 1) Selected <label class="c-account-access-panel__checkbox " for="23336" data-js-checkbox-label=""> <input id="23336" class="c-account-access-panel__checkbox-input" type="checkbox" data-label-for-value-missing="Please select at least one account from the options below" data-form-field-validation-on-grid=""

Selenium C# : Not able to click on an element within #shadow-root (closed) which appears when user mouse over

╄→гoц情女王★ 提交于 2021-02-05 06:57:45
问题 I have attached the screenshot for my code and marked the element that i need to click in red. This element appears after we mouse over on another object - and mouse over is successful and i can see this element get displayed, but failed to click on it My code is var LinksSurce = sourceThumb.FindElement(By.ID("linkSource")); LinksSurce.Click(); Error i am getting is Element not intractable NOTE: i have already read and tried the solutions suggested on these posts but none of them working

How to hide the warning “This type of file can harm your computer” while downloading .xml file using Chrome Chromedriver 79 with Selenium Java

一笑奈何 提交于 2021-02-05 06:38:25
问题 Despite setting safebrowsing.enabled to true / false , the warning ...This type of file can harm your computer... is still being displayed in browser. How to hide this information? 回答1: To enable downloading of file using Chrome/ChromeDriver hiding the warning This type of file can harm your computer you need to: Add the preferences: download.default_directory download.prompt_for_download download.extensions_to_open safebrowsing.enabled As well as add the following arguments to whilelist: -