xpath

How to send text to the recovery mail field of https://mail.protonmail.com/create/new?language=en using Selenium and Python

别来无恙 提交于 2021-01-28 08:02:25
问题 So im trying to get my first ProtonMail Account Generator working. My Problem is that selenium wont find either the field for the recovery mail or the Create Account button. I switched to the iframe already. Im pretty new and thought that this problem might be caused by the "new" html document which contains the bottom part (starting with the recovery email). Hope someone can help me. Screenshot from selenium import webdriver import time url = 'https://mail.protonmail.com/create/new?language

Calculating element max attribute value fails using XSLT and XPath

余生颓废 提交于 2021-01-28 08:01:35
问题 I am coding a ui.xsl to translate ui.xml into ui.html. The ui.xml is: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <layout class="QGridLayout" name="gridLayout_2"> <item row="8" column="1" colspan="12"> </item> <item row="11" column="1" colspan="2"> </item> <item row="11" column="3" colspan="2"> </item> <item row="11" column="5" colspan="2"> </item> <item row="11" column="7" colspan="3"> </item> <item row="1" column="6" colspan="3"> </item> <item row="2" column="1" colspan="3"> <

I need help finding an element with a locator

不想你离开。 提交于 2021-01-28 07:43:12
问题 I'm trying to get the elements from this xpath here is the code, there is several of these elements I cut the code down to avoid a million lines on here. html <keyword-text class="_nghost-fyp-81"><div class="keyword-text _ngcontent- fyp-81" clickabletooltiptarget="" aria-label=""><span class="keyword _ngcontent-fyp-81" aria-hidden="false">new york new york las vegas</span> <!----></div><!----><!----></keyword-text> xpath keyword_text = self.browser.find_elements_by_xpath("//span[starts-with(

Trying to select an option from the dropdown in Selenium web automation -error- “ElementNotInteractableException: could not be scrolled into view”

做~自己de王妃 提交于 2021-01-28 07:37:30
问题 package com.web.automation; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng

Why is “link” faster than “//link” in XPath?

北战南征 提交于 2021-01-28 07:35:47
问题 Given this XML, library(xml2) text = paste0( '<?xml version="1.0" encoding="UTF-8"?><items>', paste(rep( '<item type="greeting" id="9273938"> <link type="1" id="139" value="Hi"/> <link type="1" id="142" value="Hello"/> </item>', 100), collapse = "\n"), '</items>') x = xml_children(read_xml(text)) I can select all the link nodes by using "link" or "//link" and get the same result – but with very different speed: bench::mark( link = xml_find_all(x, "link"), `//link` = xml_find_all(x, "//link"))

Selenium not able to click on Get Data button on using Python

时光怂恿深爱的人放手 提交于 2021-01-28 06:22:37
问题 I am scraping data from this website . The element is below and geckodriver <img class="getdata-button" style="float:right;" src="/common/images/btn-get-data.gif" id="get" onclick="document.getElementById('submitMe').click()"> but can't get selenium to click it tried even xpath, id but not luck is there any fix or work around to get it done? 回答1: To click on the element Get Data you can use either of the following Locator Strategies: Using css_selector : driver.find_element_by_css_selector(

Loop pages and save contents in Excel file from website in Python

…衆ロ難τιáo~ 提交于 2021-01-28 06:14:27
问题 I'm trying to loop pages from this link and extract the interesting part. Please see the contents in the red circle in the image below. Here's what I've tried: url = 'http://so.eastmoney.com/Ann/s?keyword=购买物业&pageindex={}' for page in range(10): r = requests.get(url.format(page)) soup = BeautifulSoup(r.content, "html.parser") print(soup) xpath for each element (might be helpful for those that don't read Chinese): /html/body/div[3]/div/div[2]/div[2]/div[3]/h3/span --> 【润华物业】 /html/body/div[3]

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

人走茶凉 提交于 2021-01-28 06:04:51
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

时间秒杀一切 提交于 2021-01-28 05:55:00
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

XPATH 1.0 : match not empty elements

折月煮酒 提交于 2021-01-28 04:52:54
问题 I need to match elements that contain neither PCDATA nor child elements. I tried this: .//myelem[count(nodes())=0] but nodes() is unknown in XPATH 1.0. What is the most concise way that you know of to do this in XPATH 1.0 ? 回答1: You were close - it is node() , not nodes() : .//myelem[count(node()) = 0] or, more idiomatically: .//myelem[not(node())] 来源: https://stackoverflow.com/questions/1914085/xpath-1-0-match-not-empty-elements