Skip to content
 
 

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

XPATH

This class is from a video tutorial I did on youtube. It is very simple and should be built upon. I will keep this version the same as the video.

##Basic Example

// Create an instance of XPATH
$path = new XPATH("http://example.com");

// An example query. This will grab all the link href attributes from a page
$links = $path->query("//a/@href");

// loop through and output node values
if($links->length > 0){
    foreach($links as $link) {
        echo $link->nodeValue . "<br>";
    }
}

###Youtube videos on Scraping Websites with Xpath

###More useful Links

I dont usually link to w3fools but they have a nice Xpath syntax reference, even MDN links to it.

Hope you find this useful.

-Nate Wiley

Follow me on Twitter

Add me to a circle G+

About

PHP class for scraping websites with XPath.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages