Skip to content
/ XPATH Public

This class is from a video tutorial I did on youtube.

License

Notifications You must be signed in to change notification settings

Razor303/XPATH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

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

This class is from a video tutorial I did on youtube.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published