RE: Downloading TSV files

[email protected] (Meir Guttman) Thu, 28 Oct 2010 15:43:03 +0200
Newsgroups perl.libwww
Message-ID <!&!AAAAAAAAAAAYAAAAAAAAAKC25OsDcMdGneFIQhy+Pc3CgAAAEAAAAME1AkL5HO1CrPRtPYUVYAgBAAAAAA==@guttman.co.il>
Dear Bjoern,

 

To be honest, I couldn't understand your post, since "wget" was not part of
my toolkit. So I took the trouble to look it up, download it, install it,
read the manual and experiment a little with it.

 

Yes, you are right, the downloading of the HTML version of the right page
was somewhat successful, namely, it was subject to the finicky behavior of
the TASE site. Fine!

 

Unfortunately, it seems to me that the TSV file I am looking to download is
by no means static. IMHO it is dynamically generated, using a server side
JavaScript. The TSV download seems to be initiated by the following
"onclick" clause:

 

<a  class="ExcelLink"
onclick="javascript:customWindowOpen('/TASE/Pages/Export.aspx?sn=Excelds&Tbl
Id=0&Titles=en-US_AddColTitles&Columns=en-US_AddColColumns&enumTblType=AllSe
curities&AddCol=1&ExportType=4', '_blank', 'scrollbars=yes; toolbar=yes;
menubar=yes; resizable=yes', 800, 450);return false;"
href="javascript:void(0)">TSV</a>

 

And the customWindowOpen javascript is defined as:

 

<script language="javascript">

            function customWindowOpen(strUrl, strWindow, strParams, iWidth,
iHeight)

            {

                  Var iLeft, iTop;

                  iLeft = (window.screen.width - iWidth) / 2;

                  iTop = (window.screen.height - iHeight) / 2;

                  strParams = strParams + ",width=" + iWidth.toString() +
",height=" +

iHeight.toString() + ",left=" + iLeft.toString() + ",top=" +
iTop.toString();

                  window.open(strUrl, strWindow, strParams);

                  

            }

      </script>

 

Am I making sense???

 

I couldn't find any reference to invoking javascripts in wget. Are you sure
it does support javascript?

 

Does LWP support javascript?

 

Regards,

Meir

 

-----Original Message-----
From: Bjoern Hoehrmann [mailto:[email protected]] 
Sent: Wednesday, October 27, 2010 1:39 PM
To: Meir Guttman
Cc: [email protected]
Subject: Re: Downloading TSV files

 

* Meir Guttman wrote:

>I have also to warn you that this site is notoriously finicky. It is

>probably overloaded (and overwhelmed) by users. Lately I experience

>many types of false downloads and other problems that require repeated

>downloading trials. (I'll supply the file integrity check.)

 

Well, that might be the only problem, I had no trouble downloading the

file using `wget --save-cookies=cookies --load-cookies=cookies --keep-

session-cookies ...` except that you apparently first have to open the

HTML version of the table and then immediately thereafter download the

TSV version (that might take a few tries, whether I use wget or the web

browser).

-- 

Björn Höhrmann · mailto:[email protected] · http://bjoern.hoehrmann.de

Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de

25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/