selenium-webdriver

Send keys without specifying element in python selenium webdriver

空扰寡人 提交于 2020-05-09 20:31:05
问题 I have a page whose source code is not available, but there is a input box where cursor is blinking. Can i write something into the text box without finding the element. I mean, some way where send key can automatically look for focussed inputbox and type input to it. My code does not work obviuosly driver.send_keys("testdata") 回答1: solved it from selenium.webdriver.common.action_chains import ActionChains actions = ActionChains(self.driver) actions.send_keys('dummydata') actions.perform()

Iterate through table rows and print column text with Python Selenium

好久不见. 提交于 2020-05-09 18:33:00
问题 I have a table ( <table> ) with values in each row ( <tr> ) from its body ( <tbody> ). The value I would lile to print out is in the <span> inside a <div> tag. Inspecting the html, I see the value e.g. "Name" is in row 1 (tr[1]), column 2 (td[2]): <tr class="GAT4PNUFG GAT4PNUMG" __gwt_subrow="0" __gwt_row="0"> <td class="GAT4PNUEG GAT4PNUGG GAT4PNUHG GAT4PNUNG"> <td class="GAT4PNUEG GAT4PNUGG GAT4PNUNG"> <div __gwt_cell="cell-gwt-uid-324" style="outline-style:none;"> <span class="linkhover"

Iterate through table rows and print column text with Python Selenium

巧了我就是萌 提交于 2020-05-09 18:32:09
问题 I have a table ( <table> ) with values in each row ( <tr> ) from its body ( <tbody> ). The value I would lile to print out is in the <span> inside a <div> tag. Inspecting the html, I see the value e.g. "Name" is in row 1 (tr[1]), column 2 (td[2]): <tr class="GAT4PNUFG GAT4PNUMG" __gwt_subrow="0" __gwt_row="0"> <td class="GAT4PNUEG GAT4PNUGG GAT4PNUHG GAT4PNUNG"> <td class="GAT4PNUEG GAT4PNUGG GAT4PNUNG"> <div __gwt_cell="cell-gwt-uid-324" style="outline-style:none;"> <span class="linkhover"

Headless automation with Nodejs Selenium Webdriver

烂漫一生 提交于 2020-05-09 18:06:12
问题 I am working with an automation tool which has to be deployed inside an ubuntu server, my wonder is if is possible to use chrome in a silent way with Selenium Webdriver. I've tried the following code so far, but it keeps opening the browser (I'm doing the tests in a Windows 10): var webdriver = require('selenium-webdriver'), chrome = require('selenium-webdriver/chrome') By = webdriver.By, until = webdriver.until, options = new chrome.Options(); options.addArguments('--headless'); var path =

Extract HTML source code without any class or div (python selenium)

♀尐吖头ヾ 提交于 2020-05-09 17:20:10
问题 I have list that does not contain any unique div or class. I want to copy the HTML source code for each row below. I cannot find the class for the row. When I open the 'Edit HTML' I see the following code: <tr style="font-size: 11px"> <td class="center"><a href="/countries/1"><img alt="" src="/assets/flags/flag_1-1db156e1884c1b3d5614b55996cf96cd38843b290c7c43bdd5abbdb944b4075c.gif"></a></td> <td><a href="/employees/9526577">Bernard Aarslev</a></td> <td><a href="/clubs/1200094">Kirslev FC</a><

Web scraping through pagination list

前提是你 提交于 2020-05-09 17:14:18
问题 I would like to search through a list (see below figure) that is very long, over 100 pages. The list contains football scouts and I am only interested in those with specific attributes. The attributes can be seen when hovering the mouse over the small boxes on the right side (yellow highlights). The script should extract the scout with 3 attributes = 20. (Discipline 20, Motivation 20, Potential assessment 20). The chosen scouts should be inserted into an excel sheet (see second figure below)

Selenium and Python3 ChromeDriver raises Message: Can not connect to the Service chromedriver

时光总嘲笑我的痴心妄想 提交于 2020-05-01 14:05:59
问题 Please how do get selenium working in this scenerio? I have seen this questions times with fewer or no answers and i hope luck is on my side today. Let me start by detailing my environment. I am running MacOS Seirra . I am using virtualenv/virtualenvwrapper with python3 to run the following. from selenium import webdriver from selenium.webdriver.common.keys import Keys import os chromedriver = "/usr/local/bin/chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver =

CSS selector and XPath in Selenium Python [closed]

谁说我不能喝 提交于 2020-05-01 06:41:12
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . How about using CSS selector in Selenium Python if I am not getting id or name or class of that HTML element ? How about preferring CSS in comparison to XPath? 回答1: No idea what you are trying to ask here. I can only take a guess. How about using css selector in Selenium Python if I am not getting

CSS selector and XPath in Selenium Python [closed]

大憨熊 提交于 2020-05-01 06:39:28
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . How about using CSS selector in Selenium Python if I am not getting id or name or class of that HTML element ? How about preferring CSS in comparison to XPath? 回答1: No idea what you are trying to ask here. I can only take a guess. How about using css selector in Selenium Python if I am not getting

python selenium scrape the whole table

断了今生、忘了曾经 提交于 2020-04-30 16:36:18
问题 The purpose of this code is to scrape a data table form a some links then turn it into a pandas data frame. The problem is that this code only scrapes the first 7 rows only which are in the first page of the table and I want to capture the whole table. so when i tried to loop over table pages, i got an error. Here is the code: from selenium import webdriver urls = open(r"C:\Users\Sayed\Desktop\script\sample.txt").readlines() for url in urls: driver = webdriver.Chrome(r"D:\Projects\Tutorial