Friday, 9 August 2013

DOM - Get nodeValue of a certain part of the document

DOM - Get nodeValue of a certain part of the document

I've just started to dabble into the cURL class and DOM objects. So I was
giving this a try: I've created a cURL object that grabs the html from a
website. I call it $myhtml, the DOMDocument class then loads $myhtml via
loadHTML(). A DOM object is created as a result, and is then passed into
DOMXPath class which then evaluates the object via the
evaluate('path/to/node') function. Then nodeValue is called to return the
values.
Now, my question is, how can I retrieve certain parts of the html? say in
the for example.

No comments:

Post a Comment