Page 1 of 1

No text to point to in the TAG command

Posted: Thu Mar 11, 2010 10:08 pm
by mguttman
I am trying to create a macro that will run daily and download a specific datafile.

To download it manually, I click it in the red-rectangle-marked cell in the following screen shot:
TASE_table.jpg
TASE_table.jpg (116.53 KiB) Viewed 1438 times
As you can see from the Macro below, the ATTR=TXT: value there is the file size at that particular date and this usually change from day to day. (The "Kb" part though does not change!)

How do I change the following download macro so that it will be work every day, regardless of its file size:

Code: Select all

VERSION BUILD=6600217 RECORDER=FX
TAB T=1
URL GOTO=https://www.tase.co.il/TASEEng/MarketData/RawData/FileDistribution.htm
URL GOTO=https://www.tase.co.il/FileDistribution/TargetFolder/08031101.tas
ONDOWNLOAD FOLDER=C:\My<SP>Documents\Temp\Assemble FILE=file_803_{{!NOW:yyyymmdd}}.tas WAIT=YES
ONDOWNLOAD FOLDER=C:\My<SP>Documents\Temp\Assemble FILE=file_803_{{!NOW:yyyymmdd}}.tas WAIT=YES
TAG POS=1 TYPE=A ATTR=TXT:163
BTW #1: Does anybody know why the recording process placed the ONDOWNLOAD clause twice?

BTW #2: The ONDOWNLOAD clause works fine here, unlike in another case, posted separately.

Re: No text to point to in the TAG command

Posted: Mon Mar 15, 2010 10:45 pm
by mguttman
And Daniel,

Please, this one too!

Meir

Re: No text to point to in the TAG command

Posted: Tue Mar 16, 2010 3:07 pm
by Daniel, Tech Support
Hi Meir,

Sorry about the delay! What is static there? Is the "List of securities" static? You could then use relative positioning. Could you post here the HTML code for that piece of the page?

Best regards,

Re: No text to point to in the TAG command

Posted: Tue Mar 16, 2010 7:12 pm
by mguttman
Hi Daniel,

By "static" I mean that the file is created once and linked to. Then, when you click it, it is downloaded as-is, without any further processing. This is as opposed to other data typically on this site. This other data are HTML code and contents meant for viewing. But when you click on the "Export" (TSV or otherwise) button, it is dynamically translated, on-the-spot to the requested format. In other words, between the clicking and the actual downloading, a script is invoked which is not controlled anymore by the ONDOWNLOAD clause.

I think the best way for me to give you the HTML code is to post here the URL.

The desired file(s) is (are) any in the two rightmost columns in the table.

What is, how you program "relative positioning" and why would that solve the problem?

Regards,
Meir

Re: No text to point to in the TAG command

Posted: Fri Mar 19, 2010 7:37 pm
by Daniel, Tech Support
Hi Meir,

I'm afraid you misunderstood me. I was asking if the text "List of Securities ( structure0803)" changes at all. If not, we can use relative positioning and get the 1st link after it.

In this case it would look like this:

Code: Select all

URL GOTO=https://www.tase.co.il/TASEEng/MarketData/RawData/?a=84806898634043696694576085
TAG POS=1 TYPE=A ATTR=TXT:List<SP>of<SP>Securities* EXTRACT=TXT
ONDOWNLOAD FOLDER=C:\ FILE=* WAIT=YES
TAG POS=R1 TYPE=A ATTR=TXT:*
Best regards,

Re: No text to point to in the TAG command

Posted: Sat Mar 20, 2010 5:48 pm
by mguttman
Hi Daniel,

Yes, indeed I misunderstood you! Sorry!

And to answer your question, the text to the left of the link is indeed "static" in the sense that this is always the caption to the left of the cell and link to be clicked on. And your "relative positioning" script indeed worked. Thanks!

(I'll have to go into it and experiment some more with this feature before I'll feel confident but I think I got the idea behind it. Clever!)

Thanks again!

Meir

Re: No text to point to in the TAG command

Posted: Mon Mar 22, 2010 6:57 pm
by Daniel, Tech Support
Hi Meir,

Not at all! I am glad it worked! :)

All the best!