mainceaft
Senior Member
- Apr 10, 2013
- 881
- 184
Hi all , I have this idea in mind long time ago , since first time I know about php and curl ,
any way I found this sitemap generator thats crawl entire site and literally grape all it pages links ,
I run it on one site an it grape ~8k pages ling (it was big site ) , this script name is Simple site crawler (Google it ) , it create sitemap.xml for the site you targeting , I modify the code to get ride of extra (.xml tags) leaving only urls .
here is the code (use it on your own ) https://pastebin.com/55Mf5AuB
save it as `sitemap.php` and run it like this
I can add simple function to save each page the script crawled to separate file but that will create a lot of mess and huge number of files ,
So what solution you suggest to temporally save these page to process it data later ,
Should I use DB to store pages contents ( e.g SQLite or MySQL ) or put the whole contents on septate .xml file ( and extend it contents in each time the script crewel new page )
any way I found this sitemap generator thats crawl entire site and literally grape all it pages links ,
I run it on one site an it grape ~8k pages ling (it was big site ) , this script name is Simple site crawler (Google it ) , it create sitemap.xml for the site you targeting , I modify the code to get ride of extra (.xml tags) leaving only urls .
here is the code (use it on your own ) https://pastebin.com/55Mf5AuB
save it as `sitemap.php` and run it like this
the script on it state are useless since it only saves site url , while our goal is to scrape the whole site and save it data , I know there is some other php scraping script but all of them are complicated slow and not easy to get data out of it ,php sitemap.php
I can add simple function to save each page the script crawled to separate file but that will create a lot of mess and huge number of files ,
So what solution you suggest to temporally save these page to process it data later ,
Should I use DB to store pages contents ( e.g SQLite or MySQL ) or put the whole contents on septate .xml file ( and extend it contents in each time the script crewel new page )