HTTrack Website Copier
Free software offline browser - FORUM
Subject: new callback link-detected2
Author: GuiOm
Date: 10/11/2004 17:21
 
Hi,

thank you for adding this feature.
I achieved doing what I wanted but not without problems :)

It's a little complex when link are generated by Javascript 
code because the start_tag is not the html tag which embed 
the link but a <script> tag.

A little example to make myself clearer...
if the HTML page contains:

<html><body>
<script language=javascript>document.write("<a 
href=\'foo.html\'><img 
src=\'pictures/mypicture.gif\"></a>");</script>
</body></html>

link-detected2 gives first
link = foo.html
tag = <script language=javascript>document.write("<a 
href=\'foo.html\'><img 
src=\'pictures/mypicture.gif\"></a>");</script>
</body></html>

and then 
link = 'pictures/mypicture.gif
tag = <script language=javascript>document.write("<a 
href=\'foo.html\'><img 
src=\'pictures/mypicture.gif\"></a>");</script>
</body></html>

Do you see my problem?It is difficult to know where does the link comes from 
(img, href...)

So in my callback function I need to check the tag and, if 
it's a script one, go and search the "href" string, 
retrieve the link after the = \' and compare it to the link 
given by link-detected.
(I don't want to retrive links from a href tags)

Xavier, did you plan to add another callback more friendly 
on javascripts or not?
Thank you again.
GuiOm
 
Reply


All articles

Subject Author Date
new callback link-detected2

10/11/2004 17:21
Re: new callback link-detected2

10/17/2004 18:00




6

Created with FORUM 2.0.11