How to automate links clicking from Sheets to browser?

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
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

How to automate links clicking from Sheets to browser?

Post by Moshep » Tue Nov 03, 2020 12:46 pm

Hi guys,

First of all - nice to meet you all. I'm new here and i'm trying to get my first steps with this great tool.

I'm trying to automate a proccess of saving a lot of pages to linkedin lists
The process scenario is:
1. Click on a link from google sheets
2. Click on linkedin "more" (3 points) button
3. Save the page to a user's list
4. Select the relevant list

The problem is that I can't find a way to repeat these steps for Google Sheets
I need, of course, to click on each link once and save it to the list, than go on to the next one

Browser: Chrome
OS: Windows 10 x64
iMacros free version

Script:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://www.url.com
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/relevanttab
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember415
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Here's a screenshot for you to understand the structure (not so complicated, but still lol)
‏‏GSEx.PNG
‏‏GSEx.PNG (15.17 KiB) Viewed 1769 times
Thanks for your help!
Last edited by Moshep on Tue Nov 03, 2020 2:03 pm, edited 1 time in total.
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser

Post by chivracq » Tue Nov 03, 2020 1:20 pm

Moshep wrote:
Tue Nov 03, 2020 12:46 pm
Hi guys,

First of all - nice to meet you all. I'm new here and i'm trying to get my first steps with this great tool.

I'm trying to automate a proccess of saving a lot of pages to linkedin lists
The process scenario is:
1. Click on a link from google sheets
2. Click on linkedin "more" (3 points) button
3. Save the page to a user's list
4. Select the relevant list

The problem is that I can't find a way to repeat these steps for Google Sheets
I need, of course, to click on each link once and save it to the list, than go on to the next one

Here's a screenshot for you to understand the structure (not so complicated, but still lol)

Code: Select all

https://ibb.co/1ZTT9gv
Thanks for your help!

Alright, Welcome to the Forum... :D

A few "Remarks" if you want to "speed up the Process of getting some Help"...: :idea:

1- Can you add a Question Mark to your Thread Title...? (You are not sharing a 'HowTo'... :? )

2- Read the Forum Rules... :idea:

3- From the Forum Rules... => Can you (re)upload your Screenshot directly to the Forum...? Thank you...

4- CIM...! :mrgreen: (Read my Sig also...)

5- Then hum..., no Script posted, and no mention about what you've tried... => Then I will "only" give some "generic" Advice... (... once you'll have "complied" with Items [1-4]...) :|
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser

Post by Moshep » Tue Nov 03, 2020 2:04 pm

chivracq wrote:
Tue Nov 03, 2020 1:20 pm
Moshep wrote:
Tue Nov 03, 2020 12:46 pm
Hi guys,

First of all - nice to meet you all. I'm new here and i'm trying to get my first steps with this great tool.

I'm trying to automate a proccess of saving a lot of pages to linkedin lists
The process scenario is:
1. Click on a link from google sheets
2. Click on linkedin "more" (3 points) button
3. Save the page to a user's list
4. Select the relevant list

The problem is that I can't find a way to repeat these steps for Google Sheets
I need, of course, to click on each link once and save it to the list, than go on to the next one

Here's a screenshot for you to understand the structure (not so complicated, but still lol)

Code: Select all

https://ibb.co/1ZTT9gv
Thanks for your help!

Alright, Welcome to the Forum... :D

A few "Remarks" if you want to "speed up the Process of getting some Help"...: :idea:

1- Can you add a Question Mark to your Thread Title...? (You are not sharing a 'HowTo'... :? )

2- Read the Forum Rules... :idea:

3- From the Forum Rules... => Can you (re)upload your Screenshot directly to the Forum...? Thank you...

4- CIM...! :mrgreen: (Read my Sig also...)

5- Then hum..., no Script posted, and no mention about what you've tried... => Then I will "only" give some "generic" Advice... (... once you'll have "complied" with Items [1-4]...) :|

Thanks for the quick response!
Completly understood, sorry for the missing info!
I hope the code will help but i'm not sure
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser?

Post by chivracq » Tue Nov 03, 2020 2:51 pm

Moshep wrote:
Tue Nov 03, 2020 2:04 pm
Thanks for the quick response!
Completly understood, sorry for the missing info!
I hope the code will help but i'm not sure

OK, good, but "take it easy" with Quoting, you don't "need" to requote yourself again, that doesn't help for Readability of the Thread otherwise...

But OK, you've improved/corrected most "Points" I had mentioned in my first Reply... Good-good...! :D
=> Requoting the (whole) OP as the Content has quite "evolved" since the "original" OP:
Moshep wrote:
Tue Nov 03, 2020 12:46 pm
Hi guys,

First of all - nice to meet you all. I'm new here and i'm trying to get my first steps with this great tool.

I'm trying to automate a proccess of saving a lot of pages to linkedin lists
The process scenario is:
1. Click on a link from google sheets
2. Click on linkedin "more" (3 points) button
3. Save the page to a user's list
4. Select the relevant list

The problem is that I can't find a way to repeat these steps for Google Sheets
I need, of course, to click on each link once and save it to the list, than go on to the next one

Code: Select all

Browser: Chrome
OS: Windows 10 x64
iMacros free version
Script:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://www.url.com
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/relevanttab
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember415
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Here's a screenshot for you to understand the structure (not so complicated, but still lol)

‏‏GSEx.PNG

Thanks for your help!

FCI mentioned, good, but hum, still a bit "cryptic" as most Versions are missing...! :?
But OK, will probably be:

Code: Select all

iMacros for CR v10.1.0 'Free', CR86, Win10_x64.
Then OK, you've posted your Script, but hum..., what do you have (open) in 'TAB_[1-3]'...?, "www.url.com" is not very "concrete"/explanatory for 'TAB_1', and we can only guess what 'TAB_2' and 'TAB_3' might have open...?

Is "/relevanttab" one of the Links from your GoogleSheet...? I don't see it listed on the Screenshot... :?

And is it the part that you'll want to loop...?
If that's correct, do you always get "TAG POS=2" for every single Link you click on from the GoogleSheet...?

Hum, and you mentioned "Save the page [...]" but I don't see any 'EXTRACT' and/or 'SAVEAS' Command(s) in your Script... Where is that taking place...?

>>>

+ One Remark, but the "TAG POS=23" on an 'SVG' Element on 'TAB_2' will not be very "reliable" and will be easily "broken" unless 'TAB_2' will always have the exact same Page open, but even then, that's not "very good Practice" in my Opinion..., you should try to lower the POS_Nb by either using/adding some other Attribute(s) to identify that Element a bit more "uniquely", and/or by using 'Relative Positioning' to locate/tag that Element more reliably... :idea:
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Tue Nov 03, 2020 6:00 pm

Sorry for not being clear enough, let's try againg with the relevant links:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Manually it goes like that:
1. open Google sheets
2. Click on a comapny's page link
3. LinkedIn page will open, than click on the 3 dots sign
4. Open another page named "Sales Navigator"
5. Hit Save and choose a list called "Blacklist IT Companies"
6. Jump to the next row on Google Sheets and hit the next link

This code refers to the process i need to do for one row on my Google Sheets doc
It performs well, but my question is how can i repeat the process for the next row and so on
I have ~3300 rows in this doc and i need the tool to move to the next link, click it and do the rest on linkedin
Sorry again if I didn't understand your explanation - I thought maybe if I paste the full links and explain the process again it will help you figure it out better

Thanks for your time and help,
Moshe
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser?

Post by chivracq » Tue Nov 03, 2020 6:56 pm

Moshep wrote:
Tue Nov 03, 2020 6:00 pm
Sorry for not being clear enough, let's try againg with the relevant links:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Manually it goes like that:
1. open Google sheets
2. Click on a comapny's page link
3. LinkedIn page will open, than click on the 3 dots sign
4. Open another page named "Sales Navigator"
5. Hit Save and choose a list called "Blacklist IT Companies"
6. Jump to the next row on Google Sheets and hit the next link

This code refers to the process i need to do for one row on my Google Sheets doc
It performs well, but my question is how can i repeat the process for the next row and so on
I have ~3300 rows in this doc and i need the tool to move to the next link, click it and do the rest on linkedin
Sorry again if I didn't understand your explanation - I thought maybe if I paste the full links and explain the process again it will help you figure it out better

Thanks for your time and help,
Moshe

Alright, so if I understand "correctly" and put your Steps as Comments in your Script, (sorry but with "POS=23" + "TXT:" + "ember386" + "ember74", it's nearly impossible to follow what your Script is doing or supposed to do), then that would give the following...?:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
'1. Open Google sheets:
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
'2. Click on a com[ap]ny's page link:
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation

TAB T=2
'3. LinkedIn page will open, than click on the 3 dots sign:
TAG POS=23 TYPE=SVG ATTR=TXT:
'4. Open another page named "Sales Navigator":
TAG POS=1 TYPE=A ATTR=ID:ember386

TAB T=3
'5. Hit Save:
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
'6. Choose a list called "Blacklist IT Companies":
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
=> That's correct I guess...?
And I understand that 'TAB_2' and 'TAB_3' will be opened automatically from clicking on their corresponding previous Action/Link in the Script.

I tried to have a Look at 'LinkedIn' but this Buggy Site doesn't even work (anymore) in my Default/"Prod" Browser (PM26), then I looked in FF55, but I don't see/have this "Sales Navigator" Link/Option under the 3 Dots, that's possibly some Pro/Premium Feature I don't have...

Well then, all you have to do is to loop on the Line:

Code: Select all

TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
I'm a bit "surprised" by the 'POS=2', but it's possible that GoogleSheets also contains some "Hidden" Data/Elements in the Webpage, or maybe you have another Column containing the same Link, but then you'll have to loop the 'POS=n' on Even Nb's, => 'POS=2' => 'POS=4' => 'POS=6' etc..., then you simply need to Double the Loop, with for example, stg like:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
'1. Open Google sheets:
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
'>
'2. Click on a com[ap]ny's page link:
'TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
'>
'Need to Double the Loop to loop through Company Links ('POS=2' => 'POS=4' => 'POS=6' etc...):
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
And you can loop your Script 100 times as you are using the 'Free' Version.
If you have 3,300 Rows/Links to process, well a 100 Loops per time, you will be busy for a while, ah-ah...! Looping is Unlimited if you were using the 'PE' Version, you would make your Life much easier, ah-ah...!, if you took a 'PE' License... :idea:
Possible also is to repeat your Script 2x or 3x in the same Script (Max = 50 Lines in the 'Free' Version), but you will need to add an extra Mechanism to handle 2x or 3x Links per Loop. (6 Years old Maths Level from Primary School, so that's not very complicated, ah-ah...!)

And if, like I mentioned/understood, both 'TAB_2' + 'TAB_3' get automatically opened, you'll probably need to add a Mechanism to close those Tabs with the 'TAB' Command, or after looping your Script 100x times, you will already end up with 300x Tabs open, oops...!
And I'm not sure how CR "behaves" when opening Links in a New Tab, but it's not even sure that those Tabs will keep opening as 'TAB_2' + 'TAB_3' on Loop=2, I would actually rather expect that they will become 'TAB_4' + 'TAB_5', etc...

=> You could close them directly after handling every Tab with a 'TAB CLOSE' Command, but maybe easier is to add at the end of your Script for every Loop (or for every Block if you are going to hard-copy several Blocks in the same Script):

Code: Select all

TAB T=1
TAB CLOSEALLOTHERS
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Wed Nov 04, 2020 8:43 am

Thanks so much for your detailed comment!

Here's the correct order as i understand it:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
1. open google sheets
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
2. click on one of the company's page link in the sheet
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
3. open a tab with the linkedin company's page
TAB T=2
4. Hit the 3 dots button
TAG POS=23 TYPE=SVG ATTR=TXT:
5. select show in sales navigator
TAG POS=1 TYPE=A ATTR=ID:ember386
6. Open a new tab with the company's sales navigator
TAB T=3
7. Hit 'Save' button
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
8. Select the relevant list to save the page to (in this case - Blacklist it companies)
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Sorry for keep nudging on this issue
It means a lot to our proccess and i'm not that much a script guy, so I need help fixing the script to a final result if that's ok.
As for the premium version - we're plan on doing so, but first I need to show my supervisor that this method actually works.

Here's a short gif explaining the process visually:

https://ibb.co/Zc2zyMV

(Sorry about the external link - board won't let me embedding it here.)

Thanks again for your help!
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Thu Nov 05, 2020 7:14 am

Someone has an idea?
Something to do?
It’s a bit urgent and we need it ASAP
Thanks
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser?

Post by chivracq » Thu Nov 05, 2020 11:13 am

Moshep wrote:
Wed Nov 04, 2020 8:43 am
Thanks so much for your detailed comment!

Here's the correct order as i understand it:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
1. open google sheets
URL GOTO=https://drive.google.com/file/d/relevantfilecode/view
2. click on one of the company's page link in the sheet
TAG POS=2 TYPE=A ATTR=HREF:http://www.linkedin.com/company/synnexcorporation
3. open a tab with the linkedin company's page
TAB T=2
4. Hit the 3 dots button
TAG POS=23 TYPE=SVG ATTR=TXT:
5. select show in sales navigator
TAG POS=1 TYPE=A ATTR=ID:ember386
6. Open a new tab with the company's sales navigator
TAB T=3
7. Hit 'Save' button
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
8. Select the relevant list to save the page to (in this case - Blacklist it companies)
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
Sorry for keep nudging on this issue
It means a lot to our proccess and i'm not that much a script guy, so I need help fixing the script to a final result if that's ok.
As for the premium version - we're plan on doing so, but first I need to show my supervisor that this method actually works.

Here's a short gif explaining the process visually:

https://ibb.co/Zc2zyMV

(Sorry about the external link - board won't let me embedding it here.)

Thanks again for your help!
Moshep wrote:
Thu Nov 05, 2020 7:14 am
Someone has an idea?
Something to do?
It’s a bit urgent and we need it ASAP
Thanks

OK, yep, sorry, I was a bit "busy" yesterday, (I came to iMacros 10 or 12 years ago from playing Games, oops...! :P , and that one funny Halloween Game from then is actually taking place this week, and it's "funny" to still be playing that Game, with still the exact same Scripts I had created back then, ah-ah...!), and new Threads came also to the Forum...

So..., OK, I managed to "see" your '.GIF' even if that was "a bit more complicated than I thought", because of the Speed of the '.GIF', but OK, I managed, then yep, it confirms all my Assumptions about opening new Tabs, and your GoogleSheet only has 1 Col (about the 'POS=2' for the Links)...

(And yep indeed, uploading Images or '.ZIP' Attachments to the Forum is limited to Max 256Kb, so uploading your 1Mb '.GIF' File to some external Pix Hosting Site was "legit" in this case... And hum, for a "next time" if you ever need to upload some mini-Video, I "prefer" some "real" Video Format like '.mpeg'/'.mp4'/'.avi' as I then can open that File in 'VLC' where I can pause and slow down the Speed, while that "doesn't work" with '.GIF' Files...)

>>>

Well then, I already gave you what I think is "the/a Solution" in my previous Reply, with the last Script I posted, => the one with:

Code: Select all

'Need to Double the Loop to loop through Company Links ('POS=2' => 'POS=4' => 'POS=6' etc...):
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
... combined with the 'TAB CLOSEALLOTHERS' Command to handle closing all opened Tabs except 'TAB_1' where you'll have the GoogleSheet open.

But you didn't react to that Script...(?) :o
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Sun Nov 08, 2020 9:23 am

Hi again,

Pardon my delay in response.
So, I was trying to activate the script as suggested, but it doesn't run properly. In fact, it doesn't run at all.
I thought maybe it's something in the script structure. maybe I put the loop in the wrong location. but then I changed it from the end to the beginning and still, nothing came up.
I would be happy if you can do this one last thing for me so we can finish the pilot properly and buy the full version for the whole current document, and jump into the next ones. I need you to paste the whole script - cause maybe I didn't understand you correctly

Here's the script:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://docs.google.com/spreadsheets/d/ID
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
TAB T=1
TAB CLOSEALLOTHERS
When I start the loop and hit play macro, in fact, nothing happens. It doesn't open even the first link. Can you please help?
Again - maybe I did something wrong with the script, I'm not a script guy, so it would be very helpful if you'll paste the full script as you planned it to be.
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser?

Post by chivracq » Mon Nov 09, 2020 1:01 pm

Moshep wrote:
Sun Nov 08, 2020 9:23 am
Hi again,

Pardon my delay in response.
So, I was trying to activate the script as suggested, but it doesn't run properly. In fact, it doesn't run at all.
I thought maybe it's something in the script structure. maybe I put the loop in the wrong location. but then I changed it from the end to the beginning and still, nothing came up.
I would be happy if you can do this one last thing for me so we can finish the pilot properly and buy the full version for the whole current document, and jump into the next ones. I need you to paste the whole script - cause maybe I didn't understand you correctly

Here's the script:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://docs.google.com/spreadsheets/d/ID
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
TAB T=1
TAB CLOSEALLOTHERS
When I start the loop and hit play macro, in fact, nothing happens. It doesn't open even the first link. Can you please help?
Again - maybe I did something wrong with the script, I'm not a script guy, so it would be very helpful if you'll paste the full script as you planned it to be.

Alright, I'm "back" also..., I was a bit "busy" during the WE, ah-ah...! :P

And then, hum-hum-hum..., your Script actually looks correct to me..., except that "I" wouldn't reload the GoogleSheet in 'TAB_1' upon every Loop, this is going to be "slow" otherwise, if you need to loop your Script about 3300 times, ah-ah...!
=> I would rather load the GoogleSheet once manually and then run/loop the Script from that Tab without reloading it on every Loop.

What I also find a bit "strange" is the "http" in the 'HREF' for the Link... :o
Your Links in your GS from your Screenshot all start with "www...etc", so I'm not sure where the "http://" got added from..., and I guess I would have rather "expected" "https://" instead of "http://", even if 'LinkedIn' probably has an automatic Redirect to the "https://" URL...

=> Try this one:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
TAB T=1
'URL GOTO=https://docs.google.com/spreadsheets/d/ID
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
'TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http*://www.linkedin.com/company/*
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
TAB T=1
TAB CLOSEALLOTHERS
... Or maybe even:

Code: Select all

VERSION BUILD=1010 RECORDER=CR
TAB T=1
'URL GOTO=https://docs.google.com/spreadsheets/d/ID
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
'TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:*www.linkedin.com/company/*
TAB T=2
TAG POS=23 TYPE=SVG ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:ember386
TAB T=3
TAG POS=1 TYPE=BUTTON ATTR=ID:ember74
TAG POS=1 TYPE=DIV ATTR=TXT:Blacklist:<SP>it<SP>companies
TAB T=1
TAB CLOSEALLOTHERS
The Script won't reload the GS in 'TAB_1'...


And if sit till doesn't work, you would need to "debug" the Script by following the Vars and checking what the "TAG POS={{!VAR1}} TYPE=A ATTR=HREF:*www.linkedin.com/company/*" Statement is actually "finding" on the GS... Maybe the "POS=2n" is still not correct, I was already "a bit surprised" by "POS=2/4/6/etc", and you actually only posted one Statement with "POS=2", I had to assume it would go "2/4/6/etc", maybe that's not correct, but I can't test anything from just a Screenshot...
=> Maybe an Idea if you can "share" a mini-Sample of your GoogleSheet, with the first 3 or 5 Links in it, then I could run some Test... :idea:

Debugging your Script (on 'TAB_1') could be done with following mini-Script:

Code: Select all

[code]VERSION BUILD=1010 RECORDER=CR
TAB T=1
'URL GOTO=https://docs.google.com/spreadsheets/d/ID
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
'TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:*www.linkedin.com/company/* EXTRACT=TXT
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>VAR1:<SP>_{{!VAR1}}_<BR><BR>URL:<BR>_{{!EXTRACT}}_
WAIT SECONDS=2
And you loop it 3-5 times to check what you get in the 'PROMPT'...

>>>

And for those "interested", parallel Thread on SOF:
- How to automate iMacros link clicking on Google Sheets

Hum..., looks like @OP is "again" sharing a 'HowTo'..., and FCI not mentioned... :( :?
No Replies/Answers yet...

@OP, perfectly fine to open parallel Threads on different Tech Forums, but you "need" to provide the same "Quality" (and Follow-up) on all Threads/Forums, ... or I stop helping... :idea:
(And deleting one of the parallel Threads on one of the Forums, (which many Users do on SOF), is then also a "Show-Stopper" for me to help further/again...)
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Tue Nov 10, 2020 8:49 am

Hi there again @chivracq, and a thousand thanks for your detailed comment and for trying to help.

Let's start with SOF issue. you're right. I should use the tools you suggested here also there, and I'm sorry about the syntax.
You need to understand we're trying to solve a big problem in our work process and time is against us - so I tried to find a solution before we dump it and find another tool/method.
We want to buy a full version which will work on a bigger scale of files - but we can't do it before this tool will actually work.
Anyway, sorry again for the inconvenience.

Let's move forward.
I'm sorry but the script isn't working again. I tried all of them including debugging. It's just doesn't work.
So I thought maybe we move to the last step possible - as you suggested, here's a sample of 40 links from this document:
https://drive.google.com/file/d/17cTN_l ... sp=sharing

I hope you'll try to work with it and more than that - I hope you'll figure it out and make it work for us.
I can't understand the problem, cause each time the script running - I get a different issue. (sometimes GS isn't opening at all, sometimes links aren't open and so on)
Let's hope the file will help you figure it out and we move forward with this tool. Otherwise, we will try to find another solution for this cause my supervisor is getting impatient.

Thanks again for trying to help. I appreciate it. Let's hope we'll fix it ASAP.
chivracq
Posts: 9693
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to automate links clicking from Sheets to browser?

Post by chivracq » Tue Nov 10, 2020 8:41 pm

Moshep wrote:
Tue Nov 10, 2020 8:49 am
Hi there again @chivracq, and a thousand thanks for your detailed comment and for trying to help.

Let's start with SOF issue. you're right. I should use the tools you suggested here also there, and I'm sorry about the syntax.
You need to understand we're trying to solve a big problem in our work process and time is against us - so I tried to find a solution before we dump it and find another tool/method.
We want to buy a full version which will work on a bigger scale of files - but we can't do it before this tool will actually work.
Anyway, sorry again for the inconvenience.

Yeah well, no Need to be "sorry" and there is no "inconvenience", like I said, I find it completely "Legit" to want to open several parallel Threads on different Tech Forums to try to reach different "Specialists", even if hum..., to be honest, there is not much "Expertise" about iMacros on SOF... I'm "more or less" the only (Advanced) User answering Threads/Qt's on that Forum but I do it pretty rarely actually because I don't really "like" the Site and most Users asking Qt's about iMacros tend to delete their Qt/Thread once they've got their Answer/Script working, to avoid sharing with the "Competition", ah-ah...!, which is against "my Principles" as I help Users for the whole Community...

Maybe you'll get some Suggestions about some other Tool(s) you could use if "it doesn't work" with iMacros... I guess there are maybe about 50 other Tools like iMacros that can be used for Web-Automation, and iMacros is "just" one of those 50, ah-ah...!
I was actually checking a few Sites about the "trending" Tools to use, here + here + here for example, and iMacros is not even mentioned in any of those 3 Sites/Lists, ah-ah...! And most Names, I've never heard actually, oops...!

>>>
Moshep wrote:
Tue Nov 10, 2020 8:49 am
Let's move forward.
I'm sorry but the script isn't working again. I tried all of them including debugging. It's just doesn't work.
So I thought maybe we move to the last step possible - as you suggested, here's a sample of 40 links from this document:
https://drive.google.com/file/d/17cTN_l ... sp=sharing

I hope you'll try to work with it and more than that - I hope you'll figure it out and make it work for us.
I can't understand the problem, cause each time the script running - I get a different issue. (sometimes GS isn't opening at all, sometimes links aren't open and so on)
Let's hope the file will help you figure it out and we move forward with this tool. Otherwise, we will try to find another solution for this cause my supervisor is getting impatient.

Thanks again for trying to help. I appreciate it. Let's hope we'll fix it ASAP.

Alright, good-good, Thanks for providing the GoogleSheet Sample, and 40 Entries/Links is perfect indeed as it allows me to see already that the "ATTR=HREF:http://www.linkedin.com/company/*" wouldn't have worked anyway for all Links, as some contain "/school/" or "/showcase/" instead of "/company/" in the URL...

Then, OK, up to some Testing...
Hum, GoogleSheets / 'drive.google.com' doesn't work anymore in my Default/"Prod" Browser for iMacros (=> PM v26.3.3), I see, but it works in FF55, and hum, the following "easy" Script works then directly for me:

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
'GOTO=https://drive.google.com/file/d/17cTN_lbVkJ6Ct2rGYjoQo2ciN26fBXSQ/view

'TAG POS={{!LOOP}} TYPE=A ATTR=HREF:http://www.linkedin.com/company/*

SET !LOOP 1
TAG POS={{!LOOP}} TYPE=A ATTR=HREF:*www.linkedin.com/*
=> If I loop it 25 times, it will open the 25 first Links in the List, => until the "/showcase/thales-digital-factory" Link from Row_27, and each new Link gets each time opened on 'LinkedIn' in 'TAB_2', directly in a next Tab on the Right of the 'TAB_1' where I have the GS loaded.

Notice that I am "using" the "raw" '!LOOP', for 'POS=1' => 'POS=2' => 'POS=3' etc...
I didn't need to double the Loop like I had assumed previously was needed from your Recording.
But the GS is in "Read-Only" Mode for me, maybe that makes a Difference with you, I don't know...

Tested with:

Code: Select all

iMacros v8.9.7 for FF, FF v55.0.3, Win10_x64.
And to make 'sure", I also tested in the same Version like you use:

Code: Select all

iMacros for CR v10.1.0 'Free', CR76, Win10_x64.
=> And it works also just fine, exactly like in FF. I only looped the Script 3 times in CR because I rarely use this Browser (that I don't like at all, Reason I'm still at CR76, I've completely locked that Browser to not update...), so I was not logged into 'LinkedIn' and the Site asked me for each opened Link/Tab to complete some Captcha Checking...
- (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...
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Thu Nov 12, 2020 11:13 am

I'm getting tired of doing this -- but thanks again for your endless help! you rock!
So, I'm really confused about what to do with this tool/browser/linkedin platform
Here's the current situation:

- The script is finally actually working! I think that's a good start lol
Cons:
* I can't understand why, but it starts at row 180 instead of row 1. Can't figure out why.
* While trying to paste the rest of the script I used before, for some reason it doesn't work. Here's the error:

Code: Select all

RuntimeError: element A specified by ID:ember386 was not found, line: 12
Which means that either ember 386 is changing names for each page or Linkedin platform is something else lol

maybe we need another loop for this process?
Another thing - I tried to record again only the second part of the script (meaning - go to linkedin link - click on "view on sales navigator" - a new tab will open - hit save and select the relevant list), but for some reason this tool doesn't add to its log anything now. I'm clicking on the page but the script still stay empty (although I can see the tool's icon each time I click on something)

Well, let's hope we'll figure it out
And thank you again for your kind answers, patience and help.
Moshe
Moshep
Posts: 9
Joined: Tue Nov 03, 2020 12:29 pm

Re: How to automate links clicking from Sheets to browser?

Post by Moshep » Wed Nov 18, 2020 1:01 pm

Hi chivracq, I know I'm nudging here - but can you please assist with that issue?
It seems like we solved almost all the problems, and we need a little push to the finish line.
LMK if you can help. Thanks!
Post Reply