downloading a file

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
degouville
Posts: 2
Joined: Wed Jun 01, 2016 12:31 pm

downloading a file

Post by degouville » Wed Jun 01, 2016 1:46 pm

Hi, I am new to iMacro.
I have recorded a Marco. When I run it it should download a csv file. But nothing happens.
Here is the code

URL GOTO=https://www.msci.com/end-of-day-data-country
FRAME F=1
TAG POS=1 TYPE=A ATTR=ID:templateForm:tableResult1:0:_id206
TAG POS=1 TYPE=A ATTR=TXT:Download<SP>Data

I think that I have to modifiy the last line since it is the "Download Data" is return as a text.

Thanks
chivracq
Posts: 9412
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: downloading a file

Post by chivracq » Thu Jun 02, 2016 3:19 pm

degouville wrote:Hi, I am new to iMacro.
I have recorded a Marco. When I run it it should download a csv file. But nothing happens.
Here is the code

Code: Select all

URL GOTO=https://www.msci.com/end-of-day-data-country
FRAME F=1
TAG POS=1 TYPE=A ATTR=ID:templateForm:tableResult1:0:_id206
TAG POS=1 TYPE=A ATTR=TXT:Download<SP>Data
I think that I have to modifiy the last line since it is the "Download Data" is return as a text.

Thanks
CIM...! :mrgreen: (Always mention your FCI when you open a Thread, read my Sig, many Commands are not implemented for all Browsers/Versions...)

And say "Hi" to Marco, maybe he can help you spelling "iMacros" and "modify" correctly, Runtime Engines are very stupid, one Spelling Mistake and your Script doesn't work... :idea:

But OK, I had a look at your Site anyway even if you didn't mention your FCI (yet...!), and hum..., indeed, using my favorite Browser/FCI (iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF43), Win10-x64), I get indeed your "nothing happens" Behaviour, even after adding the 'ONDOWNLOAD' Statement which is missing from your Script.

But running the same Script on another FCI (iMacros for FF v8.9.6, FF45, Win10-x64), then it works fine and the 'historyIndex_20160601_165602.xls' gets downloaded neatly to my Default iMacros 'Downloads' Folder:

Code: Select all

VERSION BUILD=8961227 RECORDER=FX
TAB T=1
URL GOTO=https://www.msci.com/end-of-day-data-country
FRAME F=1
TAG POS=1 TYPE=A ATTR=ID:templateForm:tableResult1:0:_id206

ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}} WAIT=YES
TAG POS=1 TYPE=A ATTR=TXT:Download<SP>Data
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
degouville
Posts: 2
Joined: Wed Jun 01, 2016 12:31 pm

Re: downloading a file

Post by degouville » Fri Jun 03, 2016 2:13 pm

Hi Chivarq,
Thank for your answer and sorry for not giving my FCI : iMacros for Firefox 8.9.7, win10, FF 46.0.1. I copy/paste your code and it still does not work.

error msg : ONDOWNLOAD command was used but no download occurred. (Error code: -804)
chivracq
Posts: 9412
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: downloading a file

Post by chivracq » Sat Jun 04, 2016 1:37 am

degouville wrote:Hi Chivarq,
Thank for your answer and sorry for not giving my FCI :

Code: Select all

iMacros for Firefox 8.9.7, win10, FF 46.0.1.
I copy/paste your code and it still does not work.

error msg : ONDOWNLOAD command was used but no download occurred. (Error code: -804)
OK, perfect for FCI...

Hum, strange, I tested on a previous Version for both iMacros and FF, but I don't really believe that will make a Difference, I will try again when I will have updated FF to FF46, hum, I could try already with v8.9.7 on FF45...
And you cannot try to revert to v8.9.6 as only v8.9.7 works on FF46.

Connection Speed could play a role or the Default Settings you have in FF for handling '.XLS' Files for saving/opening them with some Program...

What you can try as well is to add some 'WAIT' Statement after the 2 Download Statements as the Macro must still be running for iMacros to catch the Download.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
janib4all
Posts: 132
Joined: Wed Jul 21, 2010 6:44 am
Location: Karachi, Sindh, Pakistan
Contact:

Re: downloading a file

Post by janib4all » Tue Jun 07, 2016 8:55 pm

Is this "0:_id206" constant every time you record the macro? If not then you have to change the scrapping pattern, try using XPATH or download complete DIV then get this special code using JS and put it in the same line.

TAG POS=1 TYPE=A ATTR=ID:templateForm:tableResult1:0:_id206
Hire the BoT-fReeak!
botspecialist.blogspot.com
Post Reply