I am trying to write a code to grab some info from a page in a website. There isn't any placeholders or XML from the webpage, so I guess it have to be done by parsing through the HTML content.
The HTML part that I would like to parse are as follows :-
<td class=\"name\">Distance:</td><td class=\"value\">4.2 mi (about 9 mins)</td>
I want to only retrieve 4.2 and 9 from the above HTML content. Is there a way to do this?
My questions are :-
How do I grab the HTML contents of the webpage?
How do I retrieve the 2 informations from the HTML content, eg. 4.2 and 9 from the above example HTML content.
I assumed the best way to get the value '4.2' is to use content "Distance" and "mi" as markers and somehow use some parsing PHP tags to get value "4.2". As for getting the value '9', I could use the "(about" and "mins)" as markers.
I am not sure how to do this in PHP. :queasy: Any tips from PHP gurus out there? :o
Thanks in advance.
Allie Syadiqin