Reputation: 1457
I would like to extract data form a spacific url such as www.example.com/data.php?id=xx
Where xx is a number between 1 and 1000 (ie. the script should loop through) and extract the data so far I have the following script:
VERSION BUILD=7401110 RECORDER=FX TAB
T=1
SET !LOOP 1
URL GOTO=http://www.example/data.php?id={{!LOOP}}
TAG POS=2 TYPE=TD ATTR=TXT:* EXTRACT=TXT
Now how can I achieve this to loop properly also if a url eg www.example.com/data.php?id=4 does not exist no data is extracted but the script continues and finally how can I get the data to be outputted to a file?
Thanks
Upvotes: 1
Views: 4326
Reputation: 1867
you need to set error ignore to make the script continue if data not found, use this:
SET !ERRORIGNORE YES
Upvotes: 1
Reputation: 321
With the macro you wrote, if you use the Loop function (that is, hit the play loop button) the macro is going to load one url after the other and extract the desired data.
However, the data is not going to be saved, but presented to you in a popup at each step. To avoid that, include the command
SET !EXTRACT_TEST_POPUP NO
at the beginning. For the saving, use SAVEAS TYPE=EXTRACT
Upvotes: 2