selenium

Travis uses Firefox 56 although Firefox 59 is installed on same system

ぐ巨炮叔叔 提交于 2021-02-10 18:00:18
问题 When running Selenium on Travis, it uses Firefox version 56. I need to use the latest version of Firefox, 59. Running apt-get update and upgrade does not solve this problem, but instead leaves the system with two different versions of Firefox, both 56 and 59. $ which firefox /usr/local/bin/firefox $ firefox --version Mozilla Firefox 56.0.2 but $ /usr/bin/firefox --version Mozilla Firefox 59.0.2 Anyone knows how to resolve this so that Firefox 59 is the only version available on the system?

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

python selenium get content of table

天涯浪子 提交于 2021-02-10 16:11:13
问题 I am trying to scrape a website using python selenium bindings. I want to get the content of a table using selenium. I am quite new to python and selenium so please excuse my ignorance. from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www.designmynight.com/london/bars/soho/six-storeys') hours = driver.find_element_by_xpath('//li[@id="hours"]') driver.find_element_by_xpath('//li[@id="hours"]').click() hoursTable = driver.find_elements_by_css_selector("table

python selenium get content of table

一个人想着一个人 提交于 2021-02-10 16:01:43
问题 I am trying to scrape a website using python selenium bindings. I want to get the content of a table using selenium. I am quite new to python and selenium so please excuse my ignorance. from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www.designmynight.com/london/bars/soho/six-storeys') hours = driver.find_element_by_xpath('//li[@id="hours"]') driver.find_element_by_xpath('//li[@id="hours"]').click() hoursTable = driver.find_elements_by_css_selector("table

python selenium get content of table

心已入冬 提交于 2021-02-10 16:01:14
问题 I am trying to scrape a website using python selenium bindings. I want to get the content of a table using selenium. I am quite new to python and selenium so please excuse my ignorance. from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www.designmynight.com/london/bars/soho/six-storeys') hours = driver.find_element_by_xpath('//li[@id="hours"]') driver.find_element_by_xpath('//li[@id="hours"]').click() hoursTable = driver.find_elements_by_css_selector("table

Python scrape table from website?

故事扮演 提交于 2021-02-10 15:53:16
问题 I'd like to scrape every treasury yield rate that is available on treasury.gov website. https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yieldAll How would I go about taking this information? I'm assuming that I'd have to use BeautifulSoup or Selenium or something like that (preferably BS4). I'd eventually like to put this data in a Pandas DataFrame. 回答1: Here's one way you can grab the data in a table using requests and beautifulsoup import

Python scrape table from website?

早过忘川 提交于 2021-02-10 15:52:12
问题 I'd like to scrape every treasury yield rate that is available on treasury.gov website. https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yieldAll How would I go about taking this information? I'm assuming that I'd have to use BeautifulSoup or Selenium or something like that (preferably BS4). I'd eventually like to put this data in a Pandas DataFrame. 回答1: Here's one way you can grab the data in a table using requests and beautifulsoup import

Change value field in html input tag using selenium in python

牧云@^-^@ 提交于 2021-02-10 15:50:00
问题 The html tag. <input id="input-value" title="Search" type="text" value=""> I want to change the value attribute from "" to "foo". <input id="input-value" title="Search" type="text" value="foo"> I am trying this with send_keys to no success. ele = browser.find_element_by_id("input-value") ele.send_keys("foo") ele.send_keys(Keys.RETURN)` 回答1: To edit the value attribute and assign the value foo to it you can use the following code block which uses the JavascriptExecutor : ele = browser.find

How to select an element based on a polyline using Selenium and Python?

孤街醉人 提交于 2021-02-10 15:41:21
问题 I am trying to select and click on an element in Selenium, but it doesn't have the typical tags, and the xpath changes on reload. The symbol stays consistent though, and I want to be able to select the button using the symbol. The HTML looks like this: <svg x="0px" y="0px" viewBox="0 0 40 34" enable-background="new 0 0 40 34" focusable="false" style="fill: rgb(255, 255, 255); stroke-width: 0px; width: 100%; --darkreader-inline-fill:#e8e6e3;" data-darkreader-inline-fill=""> <g fill="none"

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