Jump to content

Simple XPath Help Gurus!!!!


2levelsabove

Recommended Posts

OK so I am trying to capture the Root Element at: http://validator.w3.org/check?uri=http%3A%2F%2Fappraisemycar.com&charset=%28detect+automatically%29&doctype=Inline&group=0

 

which should be a simple "html"

 

I am using the following code and I dont get crap from it:

 

$domDocument	= new DOMDocument();
	@$domDocument->loadHTML($html);//suppress bad html errors
	$xPather		= new DOMXPath($domDocument);
	$xPathQuery		= "/div[@id='results_container']/form[@id='form']/table/tr[1]/td";
	$domNodes		= $xPather->query($xPathQuery);	
	foreach($domNodes as $domNode){
		$text.= (string)$domNode->textContent;
	}

 

 

Why is this not working?????? I know I am passing the right HTML and all.

IS my Xpath wrong? Please

Link to comment
https://forums.phpfreaks.com/topic/193683-simple-xpath-help-gurus/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.