Raffo
Raffo

Reputation: 1652

How to parse javascript for links with java?

I'm writing a program (in Java) that needs to extract links from webpages. I'm using htmlParser (http://htmlparser.sourceforge.net/) but I'm only able to extract html links (defined with <a href="...">) and I don't know how to handle javascript code to extract links from... can you help me??

Upvotes: 0

Views: 1842

Answers (3)

Frank Visaggio
Frank Visaggio

Reputation: 3712

This is probally the most comprehensive tool out there. Rhino . Everything you want to do can be done with Rhino.

Upvotes: 0

quarks
quarks

Reputation: 35346

HTML Parser from sourceforge is useful. I have used it to parse a whole bunch of HTML already. However, parsing JS is different. Cheers.

Upvotes: 0

Eldar Djafarov
Eldar Djafarov

Reputation: 24735

You can use Rhino with DOM environment, written in JavaScript.
By the way it is written by John Resig.

Upvotes: 2

Related Questions