Page 1 of 1

How to download pictures in embedded javascript???

Posted: Mon Jan 28, 2008 1:07 pm
by merc_slk
Hello,

I want to download the large pictures from http://www.cazar.de
But al those are embedded in a javascript called zoomwin, see example :

function zoomWin(Title,Poster)
{
myWin = window.open("", "", "width=0,height=0,scrollbars");
myWin.moveTo(0,0);
myWin.resizeTo(screen.availWidth,screen.availHeight);
myWin.document.writeln("<html>");
myWin.document.writeln("<title>CAZAR</title>");
myWin.document.writeln("<head>");
myWin.document.writeln("</head>");
myWin.document.writeln("<body bgcolor='#000000'>");
myWin.document.writeln("<center>");
myWin.document.writeln("<a href='javascript:self.close()'><font size='+1' color='#FFFFFF' face='Verdana'>Fenster schliessen</font></a><br>");
myWin.document.writeln("<br>");
myWin.document.writeln("<table cellspacing=0 cellpadding=0 border=0><td align=center width=300 height=50>");
myWin.document.writeln("<a href='javascript:self.close()'><img src=\"" + Poster + "\" hspace=0 vspace=0 border=0></a>");
myWin.document.writeln("<br><font size='+1' color='#FFFFFF' face='Verdana'>" + Title + "</font><br><font size='-1' color='#FFFFFF' face='Verdana'>© Copyright CAZAR.DE</font>");
myWin.document.writeln("</td></table>");
myWin.document.writeln("</center>");
myWin.document.writeln("</body>");
myWin.document.writeln("</html>");
myWin.focus();
}

The function is called like this :

<a href="javascript:zoomWin('Andres Sarda - Nice - BH','http://www.cazar.de/shop/out/oxbaseshop/html/0/dyn_images/d_37_andressarda/im_NICESEPE.jpg')" class="producthead">

So I want to crawl this website and download only the pictures referred in this javascript.

Can anybody help me?? Tx

Jef

Posted: Mon Feb 11, 2008 3:03 pm
by KoalaBear
PicaLoader can deal with JavaScript on many site by it default HTML Parser, but not all.
But now, PicaLoader 1.60 released, it have a new powerful feature: you can customize HTML Parser by Lua script!
So, for this site, you can create a new task:
Start URL:http://www.cazar.de/
Uncheck Support J/VB/JavaScript
Page URL Include Filters:/shop/index\.php
Page URL Exclude Filters:lang=1;cl=newsletter;cl=contact;cl=account;cl=basket;cl=suggest
Picture URL Include Filters:/im_
HTML Parser Script:

if string.find(HTML.Url,"cl=details",1,true) then
for pic in string.gmatch(HTML.Content,'javascript:zoomWin%b()') do
local ts,te=string.find(pic,"%b''");
local us,ue=string.find(pic,"%b''",te+1);
local title=string.sub(pic,ts+1,te-1);
local url=string.sub(pic,us+1,ue-1);
AddLink(url,HTML.Url,title,'',HTML.TaskID,HTML.Level);
end;
end;
DefaultParser(HTML.Content,HTML.Url,HTML.Title,HTML.TaskID,HTML.Level);

Other settings keep the default.

Posted: Wed Feb 13, 2008 3:01 pm
by KoalaBear
PicaLoader 1.61 released, and it have a new feature: Export and Import task setting. now we can share task setting easily.

You can download the attached .plt file and save to your hard disk, then run PicaLoader, open a project, select main menu->Task->Import Tasks, select the plt file that you just saved to hard disk.

Posted: Thu Feb 14, 2008 7:31 am
by Jaalpari
thanks 4 the project

Just what I need

Posted: Sun Feb 17, 2008 3:39 pm
by merc_slk
Wow great, I just does what it needs to do. Great.

does not work with me

Posted: Mon Feb 18, 2008 3:08 am
by wforecast
does not work with me :cry: finish task without downloading any picz

but nancy.plt works fine :D

why?

parser script is great tool but i don't know how to use :oops:

C U~