You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Claudio Martella <cl...@tis.bz.it> on 2010/11/25 11:27:51 UTC

about the state of parse-js and extracting links from js in general

Hello list,

I played around with parse-js about 6 months ago and found some problems
with bogus url links extraction and some infinite loops. I remember that
some of the code was considered legacy and there was some effort and
discussion about providing a new implementation (maybe in tika? i can't
find the discussion).

How is the state of parse-js? Is it still considered kind of a hack?


Thanks

Claudio

-- 
Claudio Martella
Digital Technologies
Unit Research & Development - Analyst

TIS innovation park
Via Siemens 19 | Siemensstr. 19
39100 Bolzano | 39100 Bozen
Tel. +39 0471 068 123
Fax  +39 0471 068 129
claudio.martella@tis.bz.it http://www.tis.bz.it

Short information regarding use of personal data. According to Section 13 of Italian Legislative Decree no. 196 of 30 June 2003, we inform you that we process your personal data in order to fulfil contractual and fiscal obligations and also to send you information regarding our services and events. Your personal data are processed with and without electronic means and by respecting data subjects' rights, fundamental freedoms and dignity, particularly with regard to confidentiality, personal identity and the right to personal data protection. At any time and without formalities you can write an e-mail to privacy@tis.bz.it in order to object the processing of your personal data for the purpose of sending advertising materials and also to exercise the right to access personal data and other rights referred to in Section 7 of Decree 196/2003. The data controller is TIS Techno Innovation Alto Adige, Siemens Street n. 19, Bolzano. You can find the complete information on the web site www.tis.bz.it.



Re: about the state of parse-js and extracting links from js in general

Posted by Andrzej Bialecki <ab...@getopt.org>.
On 2010-11-25 11:27, Claudio Martella wrote:
> Hello list,
> 
> I played around with parse-js about 6 months ago and found some problems
> with bogus url links extraction and some infinite loops. I remember that
> some of the code was considered legacy and there was some effort and
> discussion about providing a new implementation (maybe in tika? i can't
> find the discussion).
> 
> How is the state of parse-js? Is it still considered kind of a hack?

Pretty much yes. Since we can't afford to run a full Javascript
interpreter, we need to use some other method to extract likely URL
strings. Currently we use a simple regex - probably too simplistic.

Another possible way of attacking the problem would be to parse the
javascript using a lightweight parser (e.g. ANTLR + JS grammar) and then
traverse the AST to extract strings that look like URLs.

-- 
Best regards,
Andrzej Bialecki     <><
 ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com