Questions tagged [domxpath]

domxpath is a class in PHP's DOM API to support XPATH 1.0

domxpath called the DOMXPath is a class in PHP's DOM API that support XPATH 1.0. It provides functions to run XPATH queries on the document and retrieve specific parts of the document

492 questions
-1
votes
1 answer

get the value of domXPath from HTML

I need to parse out of my html the contents of the tag. the html looks like this: ...
-1
votes
1 answer

Scrape Text With PHP & Display On Website

I am a complete beginner with PHP. I understand the concepts but am struggling to find a tutorial I understand. My goal is this: Use the xpath addons for Firefox to select which piece of text I would like to scrape from a site Format the scraped…
Chatyak
  • 183
  • 1
  • 1
  • 11
-1
votes
1 answer

Select Class Name value in DOMXPath

Possible Duplicate: How to extract a node attribute from XML using PHP’s DOM Parser I have HTML like this: ... I just want to select the value or data-eventid across the web page but…
Vainglory07
  • 5,073
  • 10
  • 43
  • 77
-1
votes
1 answer

What is a multi branch xpath query for finding this?

This is my current xpath query: //node:Expr_Assign[subNode:var/node:Expr_Variable/subNode:Name/scalar:string='my_chinese_surname' and subNode:expr/node:Scalar_String/subNode:value/scalar:string='Qiu'] I'm trying to find it in this xml:
CMCDragonkai
  • 6,222
  • 12
  • 56
  • 98
-2
votes
1 answer

How to scrape using html class name in php crawler?

I want the rating of this book which is mentioned in the name of class. So, how can I get that class name?

$prices =…
-2
votes
2 answers

How do I extract inline JavaScript method arguments from an HTML string using PHP DOMDocument and DOMXPath

Sorry for such a long post. I request to read till the end to understand what I am trying to accomplish and what my roadblock is! I have a table like this
Subrata Sarkar
  • 2,975
  • 6
  • 45
  • 85
-2
votes
2 answers

Fetching value of specific text node using DOMXPath

From the following structure: I'm trying to fetch the marked text with the following code: $price_new='div/div[@class="cat_price"]/text()'; if ($price_new!=null && $node = $Website_Xpath->query ($price_new, $row )) { $result…
-2
votes
1 answer
-2
votes
1 answer

Cant query the xml file auto-generate from marshalling

I can't use xPath to query my xml file. I don't know where the error is and this is my schema
VuongNQ
  • 43
  • 1
  • 6
-2
votes
1 answer

Fetching an image closest to the title description text of a url php

I am trying to fetch the most relevant image from a url. I want to fetch the image that is closest to the title 'text' of the page. Or put it in a different way. I want to give scores to images based on their distance from the the title 'text'. And…
Ankit Khatri
  • 253
  • 1
  • 4
  • 11
-2
votes
1 answer

Getting non-object type randomly when traversing with php DOMDocument

Below is my code: $xpath = new DOMXPath($doc); // Start from the root element $query = '//div[contains(@class, "hudpagepad")]/div/ul/li/a'; $nodeList = @$xpath->query($query); // The size is 104 $size = $nodeList->length; for ( $i = 1; $i <=…
JohnnyQ
  • 4,839
  • 6
  • 47
  • 65
-3
votes
1 answer

Using xpath with 'contains' in php

I have:

info: abcd

....
I am trying to use xpath to select the containing "info: abcd" I have: $DNlist = $xpath->query("//div[@class='posts']/p[contains(., 'info:')]]"); This gives: Severity:…
user1592380
  • 34,265
  • 92
  • 284
  • 515
1 2 3
32
33