xpath

XPath to find a node by expression specified within another node

混江龙づ霸主 提交于 2020-06-29 04:05:22
问题 I have to create an XML mapping by entering one single XPath (1.0) for each item; worked fine until I now got an XML document like this: <PARTIES> <PARTY> <PARTY_ID type="supplier_specific">12345</PARTY_ID> <ADDRESS> <NAME>A</NAME> </ADDRESS> </PARTY> <PARTY> <PARTY_ID type="buyer_specific">54321</PARTY_ID> <ADDRESS> <NAME>B</NAME> </ADDRESS> </PARTY> <PARTY> <PARTY_ID>delivery</PARTY_ID> <ADDRESS> <NAME>C</NAME> </ADDRESS> </PARTY> <PARTIES_REFERENCE> <BUYER_IDREF type="supplier_specific"

Instagram user following automation project

假如想象 提交于 2020-06-29 03:56:26
问题 Trying to automate the process by avoiding clicking on the already requested or followed users. Instagram allows following of max. 7500 user a day. I would like to limit it to that number as well as avoid what I described in the first sentence. My code: List<WebElement> clickOnFollowButton = driver.findElements(By.xpath("//button[contains(text(),'Follow')]")); for (int i = 0; i < clickOnFollowButton.size() ; i++) { WebElement element = driver.findElements(By.xpath("//button[contains(text(),

Selenium Webdriver not finding XPATH despite seemingly identical strings

隐身守侯 提交于 2020-06-29 03:38:49
问题 This question is related to my previous two: Inducing WebDriverWait for specific elements and Inconsistency in scraping through <div>'s in Selenium. I am scraping all of the Air Jordan sneakers off of https://www.grailed.com/. The feed is an infinitely scrolling list of sneakers and I am using Selenium webdriver to scrape the data. My problem is that the images for the shoes seem to take a while to load, so it throws a lot of errors. I have found the pattern in the xpath's of the images. The

Is there a way to bind Word content controls to a custom XML Part using office-js?

不想你离开。 提交于 2020-06-28 05:07:10
问题 I'm pretty new to the Office.js/Word.js features. Trying to determine if there is there a way to bind Word content controls to a custom XML Part using the current feature sets for Office (JavaScript) Add-Ins. If not, anyone know if this feature has been requested? It can be done in the VBA and VSTO object models using by assigning an XML Mapping using XPATH. Thanks, Alan 回答1: there is no API to directly do this, however you can achieve it using OOXML insertion. Make sure to get the OOXML that

VBA to find if an element contains certain texts

▼魔方 西西 提交于 2020-06-28 03:37:14
问题 I'm new to Selenium and VBA. What i want to do is automate selection of a certain TEXT in a CSS. Selenium brings me this: css=.x-grid3-row:nth-child(42) .x-grid3-col:nth-child(4) > .x-grid3-cell-inner Everyting would be fine, except the TEXT I want to select sometimes move to different grid3-row:nth-child What I want to achieve is to find in which x-grid3-row:nth-child the desired TEXT is so I could click it with a VBA bot. Thank you for your help. 回答1: You won't be able to construct a css

How to send text to the search field through Selenium and Python

北慕城南 提交于 2020-06-27 12:06:47
问题 I am trying to pass arguments to a search text in a HTML code using Selenium in Python: I am working on the following HTML code: </form><form class="search-box-inner"> <div class="input-container"> <input type="text" class="typeahead search-box-input left" autocomplete="off" placeholder="Search ratings, research, analysts, and more..." maxlength="900"></div> </form> The code does not have id or name. It has elements by class only. I tried the following self.driver.find_elements_by_class_name(

How to send text to the search field through Selenium and Python

给你一囗甜甜゛ 提交于 2020-06-27 12:05:01
问题 I am trying to pass arguments to a search text in a HTML code using Selenium in Python: I am working on the following HTML code: </form><form class="search-box-inner"> <div class="input-container"> <input type="text" class="typeahead search-box-input left" autocomplete="off" placeholder="Search ratings, research, analysts, and more..." maxlength="900"></div> </form> The code does not have id or name. It has elements by class only. I tried the following self.driver.find_elements_by_class_name(

Exception: The XPath expression evaluated to unexpected type System.Xml.Linq.XAttribute

丶灬走出姿态 提交于 2020-06-27 07:04:45
问题 I've an XML file like below: <Employees> <Employee Id="ABC001"> <Name>Prasad 1</Name> <Mobile>9986730630</Mobile> <Address Type="Perminant"> <City>City1</City> <Country>India</Country> </Address> <Address Type="Temporary"> <City>City2</City> <Country>India</Country> </Address> </Employee> Now I want get all Address Type's. I tried like below using XPath and I'm getting exception. var xPathString = @"//Employee/Address/@Type"; doc.XPathSelectElements(xPathString); // doc is XDocument.Load("xml

Exception: The XPath expression evaluated to unexpected type System.Xml.Linq.XAttribute

回眸只為那壹抹淺笑 提交于 2020-06-27 07:04:34
问题 I've an XML file like below: <Employees> <Employee Id="ABC001"> <Name>Prasad 1</Name> <Mobile>9986730630</Mobile> <Address Type="Perminant"> <City>City1</City> <Country>India</Country> </Address> <Address Type="Temporary"> <City>City2</City> <Country>India</Country> </Address> </Employee> Now I want get all Address Type's. I tried like below using XPath and I'm getting exception. var xPathString = @"//Employee/Address/@Type"; doc.XPathSelectElements(xPathString); // doc is XDocument.Load("xml

Get xpath() to return empty values

主宰稳场 提交于 2020-06-24 07:47:47
问题 I have a situation where I have a lot of <b> tags: <b>12</b> <b>13</b> <b>14</b> <b></b> <b>121</b> As you can see, the second last tag is empty. When I call: sel.xpath('b/text()').extract() Which gives me: ['12', '13', '14', '121'] I would like to have: ['12', '13', '14', '', '121'] Is there a way to get the empty value? My current work around is to call: sel.xpath('b').extract() And then parsing through each html tag myself (the empty tags are here, which is what I want). 回答1: This is where