xpath

Python Selenium - How can I click on the third last element from a group of elements in a table?

半世苍凉 提交于 2021-02-05 12:18:29
问题 Good day everyone, Can someone explain to me how I cant get the number of elements in a table? I am running through multiple tables that all have different lengths and I always need the 3rd last item. I have the xpath of the table that contains those . Using Selenium's Python API - How do I get the number of rows in a table? I found this answer and some other answers that seem to answer my question, but to be honest: At this point I just dont understand how to implement this into my code. I

Google Sheet importxml login access

随声附和 提交于 2021-02-05 09:41:59
问题 I've used importxml to get public info from a website. But sometimes info changed when we access though different country. For example http://www.ebay.com/itm/221998403138?_trksid=p2057872.m2749.l2649&var=520870142881 this item is not available in USA but when we'll access from different country where seller shipped or changed the country of shipping, we can find the shipping cost. If I use importxml from Google Sheet, that means the access country will be USA. How far I understand i can't

Google Sheet importxml login access

让人想犯罪 __ 提交于 2021-02-05 09:41:38
问题 I've used importxml to get public info from a website. But sometimes info changed when we access though different country. For example http://www.ebay.com/itm/221998403138?_trksid=p2057872.m2749.l2649&var=520870142881 this item is not available in USA but when we'll access from different country where seller shipped or changed the country of shipping, we can find the shipping cost. If I use importxml from Google Sheet, that means the access country will be USA. How far I understand i can't

How to print the partial text from an element using Selenium and Python

安稳与你 提交于 2021-02-05 09:27:45
问题 I am trying to get the text "Album Vol.1 [Every letter I sent you] LP (Normal Edition)" from http://www.ktown4u.com/iteminfo?grp_no=231307&goods_no=44363#dt_wrap01 under the description tab but I keep getting this error message. selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":".//div[@class='view_body']/div[2]/span"} Different variations give me similar error messages. driver.find_element_by_css_selector('

XSLT 1.0 how to sum values with commas using sum() - walking in xpath

若如初见. 提交于 2021-02-05 09:13:31
问题 I have an XSLT 1.0 transformation to write and I am not finding online good solutions for my problem. I have the following XML example: <?xml version="1.0" encoding="utf-8"?> <MainDoc> <node1> <node2> <User>jsmith</User> <Amount>1,23</Amount> </node2> <node2> <User>abrown</User> <Amount>4,56</Amount> </node2> </node1> As you can see the sum function would not work due to the comma. What I need is to sum all the Amount values, i.e. 1,23 + 4,56 + etc... I tried various solutions without any

Error occured in Xpath

≯℡__Kan透↙ 提交于 2021-02-05 09:11:11
问题 I want to store comment section of this web page :- http://timesofindia.indiatimes.com/india/Officer-who-tracked-major-scams-back-in-Enforcement-Directorate/articleshow/27933692.cms this is my java code :- import java.io.*; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList;

Error occured in Xpath

随声附和 提交于 2021-02-05 09:06:08
问题 I want to store comment section of this web page :- http://timesofindia.indiatimes.com/india/Officer-who-tracked-major-scams-back-in-Enforcement-Directorate/articleshow/27933692.cms this is my java code :- import java.io.*; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList;

How to locate the last web element using classname attribute through Selenium and Python

若如初见. 提交于 2021-02-05 08:47:05
问题 getphone = driver.find_element_by_class_name('_3ko75')[-1] phone = getphone.get_attribute("title") Not working I need to get the title on string format. Exception has occurred: TypeError 'WebElement' object is not subscriptable File "C:\Users\vmaiha\Documents\Python Projects\Project 01\WP_Answer.py", line 43, in check getphone = driver.find_element_by_class_name('_3ko75')[-1] 回答1: Based on your code trials, to get the title of the last WebElement based on the value of the classname attribute

WebDriver with Java - Not able to get all the text using Webdriver

不问归期 提交于 2021-02-05 08:15:28
问题 I'm not able to get all the text on this website - https://niftygateway.com/marketplace Using this simple code - String iterativeXpath = "(//*[@id='root']/div/div[2]/div[2]/div/div[2]/div[2]/div[1]/div/div)"; iterativeXpath = iterativeXpath.substring(0, iterativeXpath.length()-1); WebDriverWait wait = new WebDriverWait(driver, 15); for(int i = 1; i <=20; i++){ wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(iterativeXpath+"["+i+"])"))); System.out.println(driver.findElement

How to select an option from the dropdown menu using Selenium and Python

倾然丶 夕夏残阳落幕 提交于 2021-02-05 08:12:26
问题 I am trying to get the fares for all combinations of stations in Metro-North using Selenium in Python. I wanted to go to their fare page, put station names into the select fields, click on the fare button, and then copy the needed values to the dataframe. I tried all possible options to select stations from the dropdown menu but nothing works as I get the error: ElementNotInteractableException . The code I tried: driver = webdriver.Safari() driver.get('http://as0.mta.info/mnr/schedules/sched