Questions tagged [xpathquery]

48 questions
1
vote
1 answer

Xidel: How to choose only 1 from many same value/class and remove unneeded elements from the result?

xidel -se '//strong[@class="n-heading"][1]/text()[1]' 'https://www.anekalogam.co.id/id' will print out 3 same outputs 15 June 2020   15 June 2020   15 June 2020   so, what should I do in order to choose…
CuriousNewbie
  • 291
  • 11
1
vote
1 answer

xpath query ingore
|
and

I am trying to build a function which cleans all the elements with empty content or without attributes from HTML document and I want to igonre
and
tags. This is my current code.
Doralb5
  • 15
  • 6
1
vote
1 answer

PHP 7 DomDocument xpath query parent parameter

I'm trying to use eBaysvc.xsd not only to validate an xml but to build the xml itself: therefore, passing as $API AddDispute I want to retrieve something like this xml:
Joe
  • 805
  • 13
  • 33
1
vote
1 answer

php 7 DomDocument XML xpath->query get subnode values

I'm trying to extract some info from eBaysvc.wsdl: passing API_Name I want to retrieve the Names of the Nodes required for such API and some more info let's suppose we want to get AddDispute Nodes, AddDisputeNode has as first node...
Joe
  • 805
  • 13
  • 33
1
vote
2 answers

php DOMDocument: how can I print an attribute of an element?

How do I print the an attribute of an element? example: $doc = new DOMDocument(); @$doc->loadHTML($page); $xpath = new DOMXPath($doc); $arts= $xpath->query("/td"); foreach ($arts as $art) { // here i wanna print the attribute class of the td…
ufk
  • 26,596
  • 55
  • 202
  • 346
1
vote
1 answer

Fetching data from Wikipedia using Xpath Query function in Google Sheets ImportXML

What would be the correct Xpath query to use to fetch data from Wikipedia into Google Sheets? Here is an example I would like to test this with: Wikipedia page: http://en.wikipedia.org/wiki/12_Angry_Men_(1957_film) Data to pull: the "running time"…
Steve
  • 191
  • 4
  • 13
1
vote
1 answer

Iterate over all Xpath results

I have this code: #!/usr/bin/groovy import javax.xml.xpath.* import javax.xml.parsers.DocumentBuilderFactory def testxml = ''' .. ..
Gilles Quenot
  • 143,367
  • 32
  • 199
  • 195
1
vote
1 answer

XPath Query: Find elements that have the same list of IDs as attributes

I need to come up with a query that gives the products of the types from which no items were sold Meaning if an item is of the type clothing, and no clothing items appear in the list of transactions, I need to display it. This is my XML file…
CodyBugstein
  • 17,496
  • 50
  • 159
  • 312
1
vote
0 answers

XPathQuery replace html string

I`m using XPathQuery lib to find nodes in a HTML Post from Wordpress, but I need to replace the found node in HTML, can anyone help me? Thanks.
Greg
  • 141
  • 2
  • 8
1
vote
2 answers

DOMDocument XPath Query to get class name and tag values

I have this sample code that will extract the values of each tags. And aside from that get the class name of that tag.. loadxml( <<< eox …
Vainglory07
  • 4,646
  • 7
  • 39
  • 75
1
vote
1 answer

XPath 2.0 Query: 1 element, check between two dates

This is how my XML-file looks like (1 record: ) 4373 Casanova 2012-11-15 15:00:00 1 0 35 Kinepolis…
BenCes
  • 165
  • 1
  • 9
0
votes
2 answers

Google Sheets ImportXML returns "Resource at URL not found" error

I am trying to pull data from Yahoo Finance into Google Sheets using the importXML function. More specifically I am trying to pull it from the "key-statistics" page on a specific stock. For some reason, whenever I try to pull a value from this…
Cojack
  • 7
  • 4
0
votes
1 answer

Is using OPENXML() the best way to transform data in an XML Column to Rows and Columns?

I have a SQL Server table with a column of type XML. The XML data represents multiple allowable selections for a given field. An example of the XML data is as follows. Valid Value 1 Valid Value 2
0
votes
1 answer

How to check Xml Element's Attribute Value in SQL

I want to select elements other than the elements whose InEx value is 'Excluded'. Here is my XML document:
Uğur Can
  • 57
  • 1
  • 10
0
votes
1 answer

Importxml function (googlesheets) not working for Skillshare website?

I'm here today because I have a strange problem using ImportXML function in Googlesheets. I'm trying to extract the hrefs (facebook, twitter, youtube, etc...) from different profiles in 2 websites: udemy.com and skillshare.com. I got my goal from…