parsing javascript from local html file

R

Rodrigo Meza

Hello Everyone
For a project I am working on, I need to retrieve links from html
documents. The easy part is to obtain 'plain' links like <A
HREF="http://site/path/document">, but when those links are
javascript'ized, the only robust solution needs to load the javascript
and dom document representation in the same way that browsers do. For
example, links in the form:

<A HREF="javascript:function_declared_before("arguments"));>

First I though that using spidermonkey (the mozilla javascript
interpreter) should be enough, but in that case, I dont have the
document structure elements (like document, window, document.history,
document.form.element, etc), so I tried parsing the document using a
library to build a tree representation of it, but that leads me to the
same problem again, that is, I have to represent all tree nodes as
javascript entities.

Anybody here have worked on a similar problem? What tools do you
think I should take a look?

Thanks in advance!

Rodrigo.
 
R

Randy Webb

Rodrigo Meza said the following on 1/11/2007 2:22 PM:
Hello Everyone
For a project I am working on, I need to retrieve links from html
documents. The easy part is to obtain 'plain' links like <A
HREF="http://site/path/document">, but when those links are
javascript'ized, the only robust solution needs to load the javascript
and dom document representation in the same way that browsers do. For
example, links in the form:

<A HREF="javascript:function_declared_before("arguments"));>

Links in that form are stupid.
 
R

Randy Webb

Rodrigo Meza said the following on 3/6/2007 5:35 PM:
I didn't invented them, I just need to parse them :)

I feel your pain. But it still a very bad way to have a link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top