xpath

how to print XML documents to the REPL console when using ConvertTo-Xml in Powershell?

此生再无相见时 提交于 2021-02-11 14:25:27
问题 "almost" printing the elements to the console: PS /home/nicholas/flwor> PS /home/nicholas/flwor> $nodes = Select-Xml "/" $xml PS /home/nicholas/flwor> PS /home/nicholas/flwor> $nodes Node Path Pattern ---- ---- ------- #document InputStream / PS /home/nicholas/flwor> not quite sure how print the actual node values. for larger context,reading in a file and converting it to xml as: PS /home/nicholas/flwor> PS /home/nicholas/flwor> $xml=./bookstore.xml PS /home/nicholas/flwor> PS /home/nicholas

How to extract the text 73 from the text 1-16 of 73 results from the search result summary within https://www.amazon.com using Selenium and Java

ε祈祈猫儿з 提交于 2021-02-11 14:24:35
问题 I am navigating to https://www.amazon.com/ there I am looking for 'samsung tv 55 inch' setting it in the search box text field then I am trying to extract the text of (63 results [see image attached]): I can't find the correct locator and how to find it, this is my code: package com.bottomline.automation.tests.ui; import com.bottomline.automation.pageobjects.model.AmazonWebPage; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AmazonTest extends

how to include the value of position() in an Xquery result?

六月ゝ 毕业季﹏ 提交于 2021-02-11 14:22:48
问题 Without using tumbling windows, how is the position itself included in a result? Obviously "$p" should be the "index" of each $item in $items. That being said, iteration isn't guaranteed to be sequential at all. output: <result> <items> <item pos="$p">5</item> <item pos="$p">3</item> <item pos="$p">7</item> <item pos="$p">2</item> <item pos="$p">7</item> <item pos="$p">3</item> </items> </result> query: xquery version "3.1"; let $items := (5,3,7,2,7,3) return <result> <items> { for $item in

How to scrape views from Youtube pages

拥有回忆 提交于 2021-02-11 14:21:22
问题 My code is good for the most part I currently get all the titles from a youtube page + do a scroll. How would I get the number of views? Would CSS or xPath work? import time from selenium import webdriver from bs4 import BeautifulSoup import requests from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from webdriver_manager.chrome import ChromeDriverManager options = Options() driver =

Xpath to extract text between specific div tag and next div

江枫思渺然 提交于 2021-02-11 14:21:04
问题 I want to extract text in <p> between the div tag 'Heading1' and the next div tag, in the example below. I can't used 'heading2 to isolate the next div as this text may change. library(XML) # create example html html <- ' <div class="AAA"> <div class="AAA">Heading1</div> </div> <p>text1 I want</p> <p>text2 I want</p> <p>text3 I want</p> <div class="AAA"> <div class="AAA">Heading2</div> <!-- Do not always know what this heading is --> </div> <p>more text</p> <p>more text</p> <p>more text</p>

Python +Selenium can't find element to send key

被刻印的时光 ゝ 提交于 2021-02-11 13:54:40
问题 I already deal with it for many days having no idea how to solve it... That is the element I want to get by selenium <input name="QUICKSEARCH_STRING" id="QUICKSEARCH_STRING" onfocus="setTimeout('focusSearchElem()', 100);" type="text" value=""> They all pop out the warning like this one ===> Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="QUICKSEARCH_STRING"]"} (Session info: chrome=79.0.3945.88) It is my code: import selenium.webdriver from

To compare selenium xpath values

随声附和 提交于 2021-02-11 13:50:21
问题 You are trying to run xpath values by comparing them. You want to compare whether there are comments or not. <div class="media-body"> <a href="https://url" class="ellipsis"> <span class="pull-right count orangered">  +26 </span> post title </a> <div class="media-info ellipsis"> admin <i class="fa fa-clock-o"></i> date </div> </div> If there is a comment, span class="full-right count or changed" is generated. If you don't have it, it won't be produced. xpath comment //*[@id="thema_wrapper"]

How can I find multiple usernames that have the same class name in Python with Selenium?

谁说我不能喝 提交于 2021-02-11 13:11:39
问题 if type == 2: for p in range(1, maxpages + 1): link = url + str(p) driver.get(link) Users = driver.find_elements_by_class_name("link span h5 hv7 secondary") print(Users[0].text) print(Users[1].text) print(Users[2].text) I hope you can understand what I'm trying to do with the code above. I'm trying to find ALL elements that have the class name: link span h5 hv7 secondary (there are over 100) And then print them out each individually. error for Nic's reply: User: <selenium.webdriver.remote

selenium.common.exceptions.TimeoutException while clicking on a button using expected_conditions presence_of_element_located in Selenium Python

℡╲_俬逩灬. 提交于 2021-02-11 13:09:20
问题 I want to create an automatic creation for Nike accounts. For that I need to add a phone number. I am coding with Python 3, Selenium and the Chrome Webdriver. This is my current code: driver.get('https://www.nike.com/de/member/settings') element2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[3]/div/div[6]/div[2]/div[2]/div/form/div[2]/div[5]/div/div/div/div[2]/button"))) driver.execute_script("arguments[0].click();", element2) time.sleep(1) This

How can I find multiple usernames that have the same class name in Python with Selenium?

那年仲夏 提交于 2021-02-11 13:04:36
问题 if type == 2: for p in range(1, maxpages + 1): link = url + str(p) driver.get(link) Users = driver.find_elements_by_class_name("link span h5 hv7 secondary") print(Users[0].text) print(Users[1].text) print(Users[2].text) I hope you can understand what I'm trying to do with the code above. I'm trying to find ALL elements that have the class name: link span h5 hv7 secondary (there are over 100) And then print them out each individually. error for Nic's reply: User: <selenium.webdriver.remote