Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > parsing javascript from local html file

Reply
Thread Tools

parsing javascript from local html file

 
 
Rodrigo Meza
Guest
Posts: n/a
 
      01-11-2007
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("argumen ts"));>

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.

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      01-12-2007
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("argumen ts"));>


Links in that form are stupid.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
 
 
 
Rodrigo Meza
Guest
Posts: n/a
 
      03-06-2007
On Jan 12, 2:38 am, Randy Webb <(E-Mail Removed)> wrote:
> 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("argumen ts"));>

>
> Links in that form are stupid.


I didn't invented them, I just need to parse them


 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      03-06-2007
Rodrigo Meza said the following on 3/6/2007 5:35 PM:
> On Jan 12, 2:38 am, Randy Webb <(E-Mail Removed)> wrote:
>> 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("argumen ts"));>

>> Links in that form are stupid.

>
> 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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing Html File on Local drive using HTMLDocument Ghistos ASP .Net 1 07-14-2008 03:17 PM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 1 02-28-2005 05:51 PM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 0 02-26-2005 10:58 AM



Advertisments