Jump to content

xpath problem


ukscotth

Recommended Posts

Hi,

 

Im having a nightmare trying to scrape some data from the freelancer.com website. I only need to scrape the job titles but for some reason it isnt working.

 

usually I would just do something like this :

 

$html = new DOMDocument();
@$html->loadHtmlFile('http://www.freelancer.com/sellers/');
$xpath = new DOMXPath( $html );
$nodelist = $xpath->query( "//div[@class='title']" );
foreach ($nodelist as $n){
echo $n->nodeValue."\n";
echo '<br>';
}

 

Its just showing blank results.

 

Any ideas ?

Link to comment
https://forums.phpfreaks.com/topic/243704-xpath-problem/
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.