Extract A Cell from Google Sheet or a CSV

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 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.
Post Reply
pranto1902
Posts: 6
Joined: Thu Aug 24, 2017 5:17 am

Extract A Cell from Google Sheet or a CSV

Post by pranto1902 » Sun Jul 01, 2018 9:46 am

Firefox 49.0.2
iMacros VERSION BUILD=8970419
Windows 10 64 Bit

Hi there,
I know It's kinda bad question. But I really need this.I tried harder to create the code using iMacros 12 but I failed.
I tried to search forum but can't find a exact solution.

Let me show you What I need.

Here is a example of google sheet. --> https://docs.google.com/spreadsheets/d/ ... =drive_web

I wanna extract a cell value.

Or,

I got a csv file like this google sheet example.
Same question there.

How Do I Extract a specific cell from a csv or from google shit??!!

I'm new to this stuff. :)

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

Re: Extract A Cell from Google Sheet or a CSV

Post by chivracq » Sun Jul 01, 2018 3:05 pm

pranto1902 wrote:

Code: Select all

Firefox 49.0.2
iMacros VERSION BUILD=8970419
Windows 10 64 Bit
Hi there,
I know It's kinda bad question. But I really need this.I tried harder to create the code using iMacros 12 but I failed.
I tried to search forum but can't find a exact solution.

Let me show you What I need.

Here is a example of google sheet. --> https://docs.google.com/spreadsheets/d/ ... =drive_web

I wanna extract a cell value.

Or,

I got a csv file like this google sheet example.
Same question there.

How Do I Extract a specific cell from a csv or from google shit??!!

I'm new to this stuff. :)

Thanks :wink:
Hum..., nice to see that you "finally" mention your FCI, which you never did in your previous Thread and where you never followed up...! :shock:
You are "a bit lucky" I find your Qt about 'GoogleSheets' a bit Interesting, I normally never (try to) help again if you don't answer my Qt's in some previous Thread(s) and of course don't follow up... Would be nice btw if you could still follow up on that old Thread of yours and finish it "a bit correctly" and "useful" for the Forum with a Solution... :idea:

>>>

But OK, I did some "quick and dirty" Testing with your GoogleSheet (oh btw...!, I'm not sure Google will be very "happy" you call it "Google shit", ah-ah...!! :shock: ), the 'TAG' Mode strangely enough doesn't really record anything "useful" for iMacros to select any Cell one by one... It would still be possible to use the 'TAG' Mode at the 'TABLE' or at some High Level 'DIV' Level, but that would be pretty cumbersome to further isolate the Data Cell by Cell...

But using the 'EVENT' Mode seems to work pretty correctly, by first selecting (with the Mouse) the first Column or even the whole Table (=> Cell 'A1' gets the Focus... which it actually already has when you load the Page for the first time, but I guess you might later want to switch between 2 Tabs in your Browser between the GoogleSheet and the Page/Site where you'll be running your Macro, and that 'A1' Cell might not always have the Focus anymore), and then using the 'Down'/'Up'/'Right'/'Left' Keyboard Arrows to navigate in the Table to the specific Cell that you want to select..., and a 'Ctrl^c' (= OS Clipboard Copy) will copy its Content to your OS Clipboard, directly from that Cell or from the Formula Bar (where the 'TAG' Mode (+ 'EXTRACT=TXT') can also be used if you prefer):

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
URL GOTO=https://docs.google.com/spreadsheets/d/1t6yelDzGwpX1O99gAXWWR21SM-VgwB-7TickMyZShj8/edit#gid=0
EVENT TYPE=CLICK SELECTOR="#\\30 -fixed>DIV:nth-of-type(1)" BUTTON=0
'EVENT TYPE=CLICK SELECTOR="#t-formula-bar-input>DIV" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#t-formula-bar-input>DIV" KEYS="[40,40,38]"

'EVENT TYPE=KEYPRESS SELECTOR="#t-formula-bar-input>DIV" CHAR="c" MODIFIERS="ctrl"
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="c" MODIFIERS="ctrl"
PROMPT _{{!CLIPBOARD}}_
=> The 'PROMPT' will display your "somthing2@gmail.com" 2nd Cell.

(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)

Your GoogleSheet is in 'ReadOnly' Mode for me, the Selectors might be a bit different for you if the Sheet is in 'Edit' Mode for you, but the Principle will be the same... :wink:

You might want to give a try to iMacros for CR, I never really tried myself (as I don't like CR and iMacros for CR), but I think that's the "only" Case where iMacros for CR might work better than iMacros for FF, as GoogleDocs "integrate" better with CR than with FF, and I think on CR you can more easily use the 'TAG' Mode to select Cells one by one (and to extract or input them).
(But if using iMacros for CR, you need to write your whole Script using only the 'TAG' Mode, even if the 'EVENT' Mode is also supported on CR (since v8.4.4), the 'MODIFIERS' and 'KEY' Parameters needed for the 'Ctrl^c' and for the Keyboard Arrows are not supported in iMacros for CR..., and if you want to use a '.CSV', you'll need the 'PE' Version ('Personal Edition') with v10.0.2 for CR which is not Free, for FIO/File Access...)

>>>

And for your Qt about a '.CSV', I'll refer you to the Wiki where all you want is extensively documented (=> all '!DATASOURCE'_xxx Commands etc...), + many Examples on the Forum if you search a mini-bit, and you even have some 'Loop-2CSV-xxx.iim' Demo-Macro explaining how to use a '.CSV' as DataSource... :idea:

>>>

OK, "good luck", and I hope you'll follow up "a bit better" on this current Thread than on your previous one (that I would still ask you to finish a bit correctly, even after 1 year, ah-ah...!), and that you'll share your Final Script... There are already a few other Threads on the Forum related to GoogleDocs/GoogleSheets, but I don't think any User(s) ever shared their Final Script/Solution, so that would still be useful for the Forum... :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...
chivracq
Posts: 7722
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract A Cell from Google Sheet or a CSV

Post by chivracq » Sun Jul 08, 2018 9:00 am

For my own "Record"/Info...: "Useless" User a bit, never follows up on their Threads, 2nd time I tried and 2nd time no Follow-up... :shock:
Oh well, fair enough, ah-ah...! :roll:
(Maybe one day, that Thread might still be useful for some other User(s)... 8) )
- (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