IMacros DATASOURCE from external source

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

IMacros DATASOURCE from external source

Post by giuseppe » Thu Jul 26, 2018 9:32 pm

Hi,
using the follow code
SET !DATASOURCE data.txt
I can extracts the data from a TXT file stored in a local disc
Can I also use google drive doc and extract data from it?
If yes,
1. Using what code?
2. With what plan (free, personal,...)? With free plan is possible?
Thanks for support.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8217
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IMacros DATASOURCE from external source

Post by chivracq » Thu Jul 26, 2018 10:28 pm

giuseppe wrote:Hi,
using the follow code

Code: Select all

SET !DATASOURCE data.txt
I can extracts the data from a TXT file stored in a local disc
Can I also use google drive doc and extract data from it?
If yes,
1. Using what code?
2. With what plan (free, personal,...)? With free plan is possible?
Thanks for support.
:roll: :wink:
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: IMacros DATASOURCE from external source

Post by giuseppe » Fri Jul 27, 2018 7:28 am

Sorry...
I go to add that in my signature...
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows 7
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8217
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IMacros DATASOURCE from external source

Post by chivracq » Fri Jul 27, 2018 3:45 pm

giuseppe wrote:Sorry...
I go to add that in my signature...
CIM are:

Code: Select all

iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows 7
Yeah, "sorry-sorry", I've been asking several times already, you seem to pay very little attention to "Details", that doesn't go very well with iMacros...
You didn't mention your FCI is some previous Thread you opened as well, reason why I didn't reply... (But I don't help for Captcha anyway...)
The 'M' in "CIM" stands for "Missing" btw..., and "iMacros" is spelt "iMacros" (Thread Title), but OK, never mind...

But yep, using Google Drive is "possible", and indeed, using a '.CSV' as a GoogleSheet is a Workaround for accessing a DataSource without File Access, now limited/disabled in v10.0.x for CR and FF in the Freeware Versions, or if you need to modify the Content of a '.CSV' "directly..., as the 'SAVEAS' Command can only append new Rows to an existing File and doesn't "really" allow you to edit its Content on the fly...
Your GoogleSheet File is then treated by the Browser and iMacros as a Browser TAB-Page, that you then can automate like any Web-Page... :idea:

Just like you can also open any Local Text File from your Browser using the 'file:///' Protocol, I've been using it for years... Only Limitation is that it doesn't "really" for Files with the '.CSV' File Extension or the Browser always thinks you want to "download" that File, even if it's already on your Local HD, you then need to rename it to '.TXT' or '.ABC' or whatever...

But handling a GoogleSheet from iMacros is then not completely straightforward...
- If you want to open your File from Google Drive, the Right Click on the File gets recorded but doesn't do anything in Replay Mode.
- The Double Click does work in Replay Mode, but doesn't get recorded (using the 'EVENT' Mode), ah-ah...! You then need to edit your Script manually to replace the 'CLICK' Value with 'DBLCLICK'.
- And the Double Click sometimes opens your File in a new Tab, and sometimes in the current Tab..., then you would need to include some Conditional Switching to TAB_2 or back to TAB_1 in your Script to make sure your Script is on the "correct" Tab.
- Luckily every File gets a specific (constant) URL, then it's more reliable to force a 'TAB OPEN' + 'URL GOTO' in TAB_2.

- Once your GoogleSheet has been opened (in TAB_2), automating it with iMacros (=> locating + extracting + saving (to) a specific Cell) is still a "painful" Process as iMacros only records accessing some Containing 'DIV' for all Cells, even with the 'EVENT' Mode.
- But "luckily", when loading the GoogleSheet, the 'A1' Cell always has the Focus and it is possible using the 'EVENT' Mode to "navigate" to a specific Cell using the Keyboard Arrows to then access (= extract/edit) its Content from the 'Formula' Bar/Field.

I always did my mini-Testing using iMacros for FF (v8.8.2 and v8.9.7 I think), and it's always not very straightforward, you need to find Workaround on Workaround..., it seems to work a little bit easier in CR, due to better Integration I guess between GoogleDocs/GoogleSheets and the Google Chrome Browser...

And on FF, you need to rely a lot on the 'EVENT' Mode..., which is not supported anymore in v10.0.2 for FF, ah-ah...! :shock:

But if you only want to "treat" that GoogleSheet as a DataSource to retrieve (and reuse) some Content like with the '!COLn' Mechanism, then you can always extract the whole Content of that 'TAB_2' Page at some "High" HTML Level, that Containing 'DIV' for example, and re-split the whole Content into some 3D Array, that's a way to go...! 8)
Hum..., and you might actually be "forced" to go this way anyway, if you happen to only have 'Read-Only' Rights on that GoogleSheet, I think the 'Formula' Field then is not present/available... (Though it might still be Hidden, I didn't check...)

I've actually started to use that Technique a few months ago, even with Local DataSources where I handle myself the Format to use for the '.CSV' in the 'SAVEAS' as it then gives me more Control when I need to access the Data than with only '{{!COLn}}' which can only locate and handle one Cell at the time, and you also need to know exactly where that Cell is located, which is not always the Case for me.... With that Technique, I can now (instantly) access the whole Content at once, or a complete Row, or complete Col, or any Cell Range... And sometimes I need the Content, but sometimes I need the Coordinates/Relative Position of that Cell/Row/Col... Everything is possible... 8)
But it's a little bit 'High Level" I guess... :oops: , you were struggling a little bit "too much" for your first Thread I would think..., (that you never finished btw...), I'm not sure you'll be able to understand and use that Technique..., ah-ah...! :wink:
- (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...
Post Reply