0

I'm trying to put together a webbot/scraper using google script.

Here is a book teaching how to do it but it is in PHP.

http://www.amazon.com/Webbots-Spiders-Screen-Scrapers-Developing/dp/1593273975/ref=pd_sim_b_3

Now, I know you can use PHP and link it into google spreadsheets. But i don't want to do that. I want everything to be in google script. Even running PHP in google script is ok. I just want to keep everything in the cloud.

Does anybody know the best way to approach this? Which libraries best to use? etc.

Thanks.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
jason
  • 3,811
  • 18
  • 92
  • 147
  • 1
    Hi, it depends on exactly wath are you trying to do. Google Apps Script runs on server and doesn't access the browser: you can't access the DOM, for example (except when you are in your own GAS generated web page). In GAS you can open web files in text mode, but you have to parse them. And GAS have time limits for scripts running. – Alejandro Silvestri May 31 '13 at 11:25

1 Answers1

2

You should look at the UrlFetch Services provided in Apps Script. There are numerous questions already here about using this service, so you should be able to find many relevant examples.

Community
  • 1
  • 1
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
  • I guess these services replace PHP? sorry for the elementary / or poorly formed questions. I'm not a programmer by trade. – jason May 31 '13 at 13:04
  • PHP scripts embed in web pages, but are executed on the server before the page is sent to a client (browser). In that sense, all apps-script is a replacement - it runs on a server, not in the client browser. But really, that's not central to this topic. The UrlFetch Services provide a way for a script to reach out to internet hosts and transact with them - you can use it to collect the web page that a browser might get, for instance. You can then dissect the page - that's what a scraper does. You MAY be able to reuse logic from the PHP Script, but probably can't just translate it. – Mogsdad May 31 '13 at 13:28
  • Thanks Mogsdad. Would you mind helping me with this question? It is related. And has to do with the application of UrlFetch services you recommend. http://stackoverflow.com/questions/16858731/html-div-nesting-using-google-fetchurl – jason May 31 '13 at 13:43