Re: please help! cannot build piggy bank

From: David Huynh <dfhuynh_at_csail.mit.edu>
Date: Wed, 26 Apr 2006 15:54:45 -0400

Hi Candide,

That's a bug in the Javascript template. Please find the scrapeAnItem
function in the code

//=========================================================
var scrapeAnItem = function(
  doc, // the HTML document you are scraping from
  node, // the HTML DOM node that represents the item to
be scraped
  detailsPagesArray, // the array of details pages
) {
    ...

and remove the comma after detailsPagesArray. If you want to fix it once
and for all, you can go into the directory (if on Windows)

C:\Documents and Settings\[your id]\Application
Data\Mozilla\Firefox\Profiles\[current profile
id]\extensions\{377cc066-cb3e-4ee8-ba63-39e761ad1cbe}\chrome\solvent\content\scripts

open up the file template-details.js and fix it there.

Sorry for the puzzling error.

David


Candide Kemmler wrote:
> OK great, I have written my own (very simple) scraper, with the help
> of Solvent. Now, I'd like to complicate things a bit: I'd want to get
> every details of each movie that is listed on this page:
>
> http://www.cinenews.be/Movies.ByPlace.cfm?YellowID=80&lang=fr
>
> ...which is my favourite movie theatre in Brussels.
>
> So I tried to insert the code that "scrapes several pages with details
> pages" with Solvent. In a first step, I'd just want to have my working
> code still working inside this template. To do that, I figured out
> that I'd have to insert it inside the scrapeAPage function. I did even
> less: just make an alert in there to make sure that the code actually
> executes to this point, like so:
>
> var scrapeAPage = function(
> doc, // the HTML document you are scraping from
> detailsPagesArray, // the array of details pages
> fDonePageCont // continuation function
> ) {
>
> alert("scraping a page");
>
> fDonePageCont();
> }
>
> But then I got this very disapointing alert:
>
> Failed to extract data using screen scraper
> file:///C:/dev/my-workspace/Piggy
> Bank/src/scrapers/js/cinenews-scraper.js
>
> Error: SyntaxError: missing formal parameter
>
> Alas, I don't understand why this error is thrown at me.
>
> Could you please help me a bit so I could get my simple scraper to
> work? I'd just want a hand to get me on my feet with the Solvent
> template. It seems very handy, but I must admit that I don't really
> understand its design.
>
> Thanks for the fun,
>
> Candide
>
> On 4/25/06, David Huynh <dfhuynh_at_csail.mit.edu> wrote:
>
>> Hi Candide,
>>
>> I suspect that you have installed your own scraper, which means that its
>> metadata (including the regular expression) is now in the My Piggy Bank
>> database. Have you tried the following?
>> - browse to the My Piggy Bank database (Tools -> Piggy Bank -> Browser
>> My Piggy Bank)
>> - click on JavascriptScreenScraper in the list on the right
>> - find your own screen scraper and delete it.
>>
>> We haven't had time to write a tutorial for Solvent, but there is a
>> screen cast for it on its site. Solvent, once you get it, should make
>> writing screen scrapers quite a bit easier.
>>
>
> What I want to do is getting
>
> --
> Candide Kemmler
> 3 rue du Bailli - 1000 Bruxelles
> mobile:+32485067980
>
Received on Wed Apr 26 2006 - 19:53:20 EDT

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT