downloading a file

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

downloading a file

by degouville on Wed Jun 01, 2016 6:46 am

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
degouville
 
Posts: 2
Joined: Wed Jun 01, 2016 5:31 am

Re: downloading a file

by chivracq on Thu Jun 02, 2016 8:19 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: downloading a file

by degouville on Fri Jun 03, 2016 7:13 am

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)
degouville
 
Posts: 2
Joined: Wed Jun 01, 2016 5:31 am

Re: downloading a file

by chivracq on Fri Jun 03, 2016 6:37 pm

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: downloading a file

by janib4all on Tue Jun 07, 2016 1: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
janib4all
 
Posts: 132
Joined: Tue Jul 20, 2010 11:44 pm
Location: Karachi, Sindh, Pakistan


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 4 guests

-->