xpath

How to get plain text with Xpath

£可爱£侵袭症+ 提交于 2021-02-05 06:25:06
问题 Hi I got this piece of html and i want to get text elements from it <span id="product_description" itemprop="description" class=""> <h1>Toltec Lighting 216-BRZ-508 Leaf Collection Traditional Potrack With Italian Marble Glass In Bronze</h1> <br class=""> <span style="font-weight: bold;" class="">MANUFACTURE: </span> Toltec Lighting <br class=" xh-highlight"> <span style="font-weight: bold;" class="">COLLECTION: </span> Leaf <br class=" xh-highlight"> </span> I want to get list of values. In

Converting flat hierarchy to nested hierarchy in XSLT depth

*爱你&永不变心* 提交于 2021-02-04 21:13:48
问题 I have some frustratingly flat XML that looks like this: <groups> <group id="1" depth="1" /> <group id="2" depth="2" /> <group id="3" depth="2" /> <group id="4" depth="3" /> <group id="5" depth="2" /> <group id="6" depth="3" /> </groups> The maximum value of depth appears to be 5 . Which I'd like to turn into XML that looks like this: <groups> <group id="1" depth="1"> <group id="2" depth="2"> </group> <group id="3" depth="2"> <group id="4" depth="3"> </group> </group> <group id="5" depth="2">

Converting flat hierarchy to nested hierarchy in XSLT depth

偶尔善良 提交于 2021-02-04 21:13:06
问题 I have some frustratingly flat XML that looks like this: <groups> <group id="1" depth="1" /> <group id="2" depth="2" /> <group id="3" depth="2" /> <group id="4" depth="3" /> <group id="5" depth="2" /> <group id="6" depth="3" /> </groups> The maximum value of depth appears to be 5 . Which I'd like to turn into XML that looks like this: <groups> <group id="1" depth="1"> <group id="2" depth="2"> </group> <group id="3" depth="2"> <group id="4" depth="3"> </group> </group> <group id="5" depth="2">

JaxB rename class with duplicate name

断了今生、忘了曾经 提交于 2021-02-04 18:40:39
问题 I have to use a schema which contains the following snippet where the name object is duplicated. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="param_object_type"> <xs:sequence> <xs:element name="object" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="object" minOccurs="0" maxOccurs="unbounded"> </xs:sequence> </xs:complexType> </xs:sequence> </xs:complexType> </xs:schema> Jaxb was originally happy to import this, but would

Selenium won't type to textarea and raises ElementNotInteractableException

大憨熊 提交于 2021-02-04 08:28:27
问题 This is the HTML code in question: <textarea rows="1" cols="1" name="text" class=""></textarea> This is my code: msgElem = driver.find_element_by_css_selector("textarea[name='text']") driver.execute_script("arguments[0].click();", msgElem) driver.execute_script("arguments[0].value = 'Whats up mate, how you doin';", msgElem) msgElem.submit() The code executes and nothing happens. I assume it selects the textarea but doesn't type nothing into it? or nothing happens at all. It also finds the

How to solve a StaleElementReferenceException: Message: stale element reference: element is not attached error using Selenium Ubuntu EC2 using Python

余生颓废 提交于 2021-02-04 08:27:30
问题 I am trying to extract all data of column "Nb B" in this page : https://www.coteur.com/cotes-foot.php When I run my code from a Ubuntu PC It works perfectly but when I tried with EC2 Ubuntu It does not give me the good return. Here is my server : ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611 (ami-0a63f96e85105c6d3) Here is the python script : #!/usr/bin/python3 # -*- coding: utf­-8 ­-*- from selenium import webdriver from selenium.webdriver.chrome.options import Options

How to click a link within youtube comment using python selenium

六眼飞鱼酱① 提交于 2021-02-04 08:26:31
问题 I'm new to selenium python, I'm trying to click a link in the youtube comment but I don't know what element to use? Can someone help me? thanks . example : <a class="yt-simple-endpoint style-scope yt-formatted-string" spellcheck="false" href="/redirect?event=comments&redir_token=ttzJJRuKzz6sJPh8qdMnWStc-958MTU0NjE1NDU4M0AxNTQ2MDY4MTgz&stzid=Ugw6ip_QkzwyJPIq3bp4AaABAg&q=https%3A%2F%2Fjulissars.itworks.com%2F" rel="nofollow">https://julissars.itworks.com</a> link 回答1: To click on the desired

How to wait until all loaders disappears using Selenium WebDriver through Java

旧巷老猫 提交于 2021-02-04 08:18:22
问题 I am using selenium web driver and I need to wait until all loaders disappear. I have 12 widgets on dashboard page and I need to wait until all widgets are loaded. Loader shows on each widget. I have used both following ways but nothing works and no errors, it just passes on to next statement. new WebDriverWait(driver,60) .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[contains(text(),'Loader')]"))); WebDriverWait wait2 = new WebDriverWait(driver,60); wait2.until

How to click a dynamic link with in a drupal 8 website using xpath/css selector while automating through Selenium and Python

三世轮回 提交于 2021-02-04 08:12:12
问题 I am trying to click on an edit tab link, and its in the form of a hyperlink in an unordered list. Here is the HTML: <li><a href="/node/2658/edit" data-drupal-link-system-path="node/2658/edit">Edit</a></li> I have been trying to use driver.find_element_by_link_text('Edit') to find the element, however always get a NoSuchElementException . I have also used the by partial text fxn, with all variations of the html, and receive the same error. There is also the following html I found that

Python Selenium SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[contains(@class, 'product-card__subtitle')

蹲街弑〆低调 提交于 2021-02-04 08:10:56
问题 Trying to get the XPath of div class and the text inside of the div. the two divs are: <div class="product-card__subtitle">Women's Shoe</div> <div class="product-card__subtitle">Men's Shoe</div> My Xpaths that are giving the selenium error are: driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text(" ")='Women's Shoe']") driver.find_element_by_xpath("//div[contains(@class, 'product-card__subtitle') and text()='Men's " "Shoe']") I am trying to get the path for