TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-01-2009, 10:04 PM   #1 (permalink)
The Wanderer
 
Join Date: Sep 2007
Posts: 11
Thanks: 2
pixelgod is on a distinguished road
Default 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!";
}
pixelgod is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Html 5 Randy XHTML, HTML, CSS 12 04-04-2013 09:26 AM
Exciting Stuff in HTML 5! Wildhoney XHTML, HTML, CSS 20 02-17-2013 03:16 PM
Replace special chars not tags, php trigered by html Peuplarchie General 0 09-20-2009 02:32 PM
[CGI] Parsing PHP in HTML aristoworks General 3 02-07-2009 02:54 AM
problem getting data on the html table.... jetnet1 General 2 11-24-2008 06:55 PM


All times are GMT. The time now is 09:36 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design