Hi, so I have multiple HTML files which I need to get some praticular data from, I mean theres a bunch of non relative information in this HTML files, but I need just lets say things that are between the <div class="myInfo">
and </div>
, after getting this information I want to handle it in my own PHP page, so for example I can insert this data into some variables. Is it even possible using PHP only?
(Forgive me for my English mistakes)
views:
46answers:
2
A:
I think you need to use CURL for that
Here is a link http://www.php.net/manual/en/book.curl.php
Starx
2010-06-08 02:07:17
+2
A:
I would use SimpleDom
http://simplehtmldom.sourceforge.net/
// Find all article blocks
foreach(file_get_html('http://smysite.com')->find('div.myInfo') as $Info) {
print_r($Info);
}
Alternative. http://php.net/manual/en/book.simplexml.php
RobertPitt
2010-06-08 02:07:44
Looks great! I'll try it right away.
SnirD
2010-06-08 02:13:08
This is the ultimate tool for DOM Parsing. along side PHP's XMLDOM Functions,, but this is a simple easy starter - i updated post because i posted incorrect link. please review
RobertPitt
2010-06-08 02:19:27
That's working just great, this tool is very powerful, thanks.
SnirD
2010-06-08 02:29:47