Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-24-2012, 08:09 PM #1
- Join Date
- Oct 2012
- Thanked 0 Times in 0 Posts
Simple Php Fetching Script Code Edit?
Hello Guys I need help urgent. I am beginner in PHP
I have downloaded more then 100K pages of a website which are in html format, and want to fetch data from these files.
What I want to fetch html tag to tag files
<title> to </title>
or <div> to </div>
in which I can easily fetch the data from downloaded files. One of my friends writes this script but don't know who to use this
I have a folder in which all files are downloaded name 'download' and want I want to fetch data and save into notepad files.
Urgent script or code required
10-24-2012, 08:23 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
PHP would be better to do this with though. Even better would be to get rid of the old .html files. 100,000 files is a hellofalot of files though.
Fetching data from them is a breeze so long as they are well formed. If they are, you can use XML handling to fetch and find what you need. If they are not, then it will be unpleasant.
What is in these files? Are they following a logical naming convention? You may not need to actually do anything with them aside from using PHP to fetch template based off of them, but that will only work if there is a method in identifying them properly. You cannot loop through 100K files at a time looking for information; that would just take far to long.
This of course all assumes that these pages are all you will ever have. You need to work to conversion of them and storing the data into a database, then serving dynamically. If these are batches of files that will constantly keep climbing, PHP isn't the language to do this with. You want to look into something much faster such as C.