Chrome Automation

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Joelyboy0991
Junior Coder
Posts: 24
Joined: Thu Oct 11, 2018 1:19 pm

Chrome Automation

Post by Joelyboy0991 » Wed Jan 25, 2023 4:45 pm

trying to automate chrome

https://www.instagram.com/p/Cn2E8epSjek ... hare_sheet

trying to follow:
https://www.mjtnet.com/blog/2020/02/27/ ... functions/

Goal:
automate Chrome and learn how to target and interact with elements
thank you.

Code: Select all

//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.

Label>Startup
Let>CHROMEDRIVER_EXE=c:\MchedRoot\chromedriver.exe
Onevent>KEY_DOWN,VK38,0,Iconclick
Onevent>KEY_DOWN,VK37,0,Startup
//Onevent>KEY_DOWN,VK40,0,Pass
//Onevent>KEY_DOWN,VK39,0,Pass2

Label>loop
Wait>5
Goto>loop

SRT>Iconclick
ChromeStart>session_id
ChromeNavigate>session_id,url,https://www.google.com/search?q=dog&oq=&aqs=chrome.0.69i59i450l8.30955370j0j15&sourceid=chrome&ie=UTF-8
ChromeFindElements>session_id,name,Search by image,Search by image_elements
END>Iconclick

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Chrome Automation

Post by Dorian (MJT support) » Thu Jan 26, 2023 10:17 am

Replied to your support ticket on the same subject.
Yes, we have a Custom Scripting Service. Message me or go here

Joelyboy0991
Junior Coder
Posts: 24
Joined: Thu Oct 11, 2018 1:19 pm

Re: Chrome Automation

Post by Joelyboy0991 » Fri Jan 27, 2023 2:35 pm

Amazing help

Cheers Mate!

Joelyboy0991
Junior Coder
Posts: 24
Joined: Thu Oct 11, 2018 1:19 pm

Re: Chrome Automation

Post by Joelyboy0991 » Fri Jan 27, 2023 2:46 pm

GOT IT!.

Code: Select all

//Method 1
//Using xpath to find <img
ChromeFindElements>session_id,xpath,//img[@class='Gdd5U'],el
//If this is >0, we found an element (helps debugging)
let>elres1=el_count
ChromeElementAction>session_id,el_1,click

Wait>1
//Using xpath to find <img
ChromeFindElements>session_id,xpath,//Span[@class='DV7the'],el
//If this is >0, we found an element (helps debugging)
let>elres1=el_count
ChromeElementAction>session_id,el_1,click
Q:

should i do some wait image screens for better timing.

or Wait>

or do i even need waits at all.

Apart from that
Working perfect!

thank you!

again!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts