Jump to content

[SOLVED] In dire need of this, webspider help (i think).


jamesxg1

Recommended Posts

Hiya foke's,

 

Im in dire need of either advice or recommendation,

 

Here goes: Basically if you go to the link i have put below this it goes to google map's with a query already entered if you look to the side you see all the text/link results and information of the establishment under it, i need get get hold of either software or php script that will rip that data into a .txt file in the way i need eg. no just the whole thing in one hit i need it nicely layed out is there anything i can do ?,

 

http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=indian+delivery+in+Berkshire&sll=52.173511,-0.411301&sspn=0.205075,0.441513&ie=UTF8&ll=52.089633,-0.411301&spn=0.194915,0.441513&z=11

 

Many many thanks,

 

James.

Link to comment
Share on other sites

I guess you do need this posting every 20 minutes :P

 

I've written a spider before and the best way to do that is use CURL to crawl the link, put the HTML in a text file and use a regular expression to get the data you want from it.

 

Just do a search for "CURL spiders" or "crawl a website with CURL" and it'll come up with a few hits.

Link to comment
Share on other sites

I guess you do need this posting every 20 minutes :P

 

I've written a spider before and the best way to do that is use CURL to crawl the link, put the HTML in a text file and use a regular expression to get the data you want from it.

 

Just do a search for "CURL spiders" or "crawl a website with CURL" and it'll come up with a few hits.

 

 

Lmfao!, DESPERATELY !! lol,

 

and ok mate 2 secz i will have a little look :),

 

thanks for the advice :) much appreciated :)

 

James.

Link to comment
Share on other sites

If you're need is really that great, I suggest you hire someone to do it.  There is no generic script when it comes to scraping pages, as each page is unique.  Learn the art of regex or open up your wallet to someone who has.

 

If you want to learn it yourself, as mentioned by previous poster, look into cURL for getting the initial page content.  You can then possibly use DOM to get what you're looking for.  If not, you're going to have to get your hands dirty with regex, using preg_match or preg_match_all

 

I'm moving this thread to the regex forum.  In that forum you can see stickies detailing resources for learning regex.

 

As far as storing it in a text file, you'd use something like fwrite (with its supporting functions, like fopen and fclose) or file_put_contents

 

As far as making it "nicely laid out" well that's up to you to decide how it should be displayed. In general, you would write a script to read the contents of the text file, using fread or file, loop through it, marking it up with html or css.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.