10-01-2009, 10:04 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Sep 2007
Posts: 11
Thanks: 2
|
Parsing HTML
Hi guys,
I don't even know where to start with this one. I have about a hundred html directory pages, and I want to convert it into a mysql database. All of the listings are enclosed in <li> and <hr> tags, so I think this should be fairly easy. The hard part will probably be extracting the information out of the listing.
I found lots of resources for scraping links, but I'm not experienced enough to convert that to my application. This is where I'm at so far:
Code:
$url = "#";
$input = @file_get_contents($url) or die('Could not access file!');
$regexp = "regex"; <- what do I put for this
if(preg_match_all("/$regexp/siU", $input, $matches)) {
}else {
echo"No matches found!";
}
|
|
|
|