Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
hotcheesesoup
Posts: 34
Joined: 08 May 2022, 01:41

Re: Rufaydium WebDriver 1.7.1 (no selenium/websocket)

Post by hotcheesesoup » 05 Nov 2022, 19:57

Xeo786 wrote:
31 Oct 2022, 02:06
Yeah I notice that after the driver update, Before, when we close any chrome tab, using Session.close() it closes it then returns with the window ID of the active tab,
But now it returns with an array of all the tabs window ID, and now it's up to us to choose which window we want to switch, and I noticed
it is always the last index in the array that is the active tab after closer, so did this
I just updated everything to your newest release. It is definitely better than it was before, but I can still get Chromedriver to close when closing the active tab maybe 10-20% of the time. I actually caught Task Manager saying Chromedriver was "Suspended" right before it disappeared. It seems like it is crashing versus closing naturally?

I tried a small change in Rufaydium.ahk and that seemed to increase reliability a little bit, but it still closes every now and then.

Code: Select all

close()
{
	Tabs := this.Send("window","DELETE")
;	this.Switch(this.currentTab := tabs[tabs.Length()])
	this.Switch(tabs[tabs.Length()])		
}
EDIT: Interesting! I went into the process details, and it actually attempted to create a second Chromedriver instance while the first was still running. This caused them to both close. I don't think I can get a screenshot of it but it definitely happened. Perhaps it attempted to create another instance using the same port so it just abandoned ship and killed both?

EDIT 2: I caught it!
image.png
image.png (18.77 KiB) Viewed 2603 times

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.1 (no selenium/websocket)

Post by Xeo786 » 06 Nov 2022, 23:53

hotcheesesoup wrote:
05 Nov 2022, 19:57
I just updated everything to your newest release. It is definitely better than it was before, but I can still get Chromedriver to close when closing the active tab maybe 10-20% of the time. I actually caught Task Manager saying Chromedriver was "Suspended" right before it disappeared. It seems like it is crashing versus closing naturally?
I suspect you are trying to close the window that is already closed, Look at Window Delete on w3c,
image.png
image.png (30.08 KiB) Viewed 2585 times
1) I would like to see your code for handling Sessions and tabs.
2) How do you reaccess a session? (when the script reloads and wants to access a existing Webdriver session again)

Creating multiple sessions and closing is a little bit complicated, you should create 1 session/ 1 Web driver process, and you can create as many windows as possible. A Webdriver with no defined user profile will create a temporary profile folder, if someone uses multiple sessions then the driver will create multiple temporary profile folders.
look at the following example, that avoid creating multiple sessions.

Code: Select all

; GetRufaydium(URL) gets existing session  
; stops us from creating multiple sessions again and again 
; make sure not to manually close driver/chrome.driver.exit()
; by Xeo786
GetRufaydium(URL)
{
	; get chrome driver / runs chrome driver if not running, download driver if available in A_ScriptDir
	; Run Chrome Driver with default parameters and loads deafult capabilities
	Chrome := new Rufaydium() ; set driver and port as per requirment
	
	; capabilities can be defined here 
	
	Page := Chrome.getSessionByUrl(URL) ; check page (created by driver) if already exist 
	if !isobject(page) ; checcking if Session with url exist
	{
		Page := Chrome.getSession(1,1) ; try getting first session first tab
		if isobject(page) ; if exist 
			Page.NewTab() ; create new tab instead new session
		else ; if session does not exist 
			Page := Chrome.NewSession() ; create new session ; Page.Exit() if any session manually closed by user which causes lag
		Page.Navigate(URL) ; navigate		
	}
	return page 
}
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

User avatar
hotcheesesoup
Posts: 34
Joined: 08 May 2022, 01:41

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by hotcheesesoup » 07 Nov 2022, 00:05

@Xeo786
The second Chromedriver.exe appears when attempting to close my active tab when other tabs exist, maybe 10-20% of the time it will close itself, and without doing anything different. I'm not telling Rufaydium to create a new one. I only do that one time when I start the script. I thought perhaps closing a tab while it is loading could cause it to close, but this isn't the case. The best workaround I've found is to simply NEVER close the active tab, and instead switch to another tab then close that previous one.

For handling tabs, I just have a simple timer running that runs Session.ActiveTab() at the top so it constantly grabs the current tab.

Code: Select all

SetTimer, ModifyPage, 16
return

ModifyPage:
gosub GetCurrentTab2

; Lots of other stuff goes here.

return

GetCurrentTab2:
if WinActive("ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe")
{
	Session.ActiveTab()
}
return
Basically at this point, since Chromedriver.exe is closing itself randomly, I don't even bother trying to access the existing one when restarting the script. I just see if it exists, kill it if it does, then create a new one. Other scripts that utilize the Chromedriver never have any issues finding it, assuming it hasn't closed itself.

I'm also not using Rufaydium to close the active tab. I'm just middle-clicking it, or pressing Control + W, or clicking the X on it.

Thanks Xeo!
-HCS

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 07 Nov 2022, 00:50

hotcheesesoup wrote:
07 Nov 2022, 00:05
@Xeo786
The second Chromedriver.exe appears when attempting to close my active tab when other tabs exist, maybe 10-20% of the time it will close itself, and without doing anything different. I'm not telling Rufaydium to create a new one. I only do that one time when I start the script. I thought perhaps closing a tab while it is loading could cause it to close, but this isn't the case. The best workaround I've found is to simply NEVER close the active tab, and instead switch to another tab then close that previous one.

For handling tabs, I just have a simple timer running that runs Session.ActiveTab() at the top so it constantly grabs the current tab.

Code: Select all

SetTimer, ModifyPage, 16
return

ModifyPage:
gosub GetCurrentTab2

; Lots of other stuff goes here.

return

GetCurrentTab2:
if WinActive("ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe")
{
	Session.ActiveTab()
}
return
Basically at this point, since Chromedriver.exe is closing itself randomly, I don't even bother trying to access the existing one when restarting the script. I just see if it exists, kill it if it does, then create a new one. Other scripts that utilize the Chromedriver never have any issues finding it, assuming it hasn't closed itself.

I'm also not using Rufaydium to close the active tab. I'm just middle-clicking it, or pressing Control + W, or clicking the X on it.

Thanks Xeo!
-HCS
why do you keep doing ActiveTab() 16 ms :?: ,
Spoiler
I have never faced issue with closing tab, you should debug something like this for closing tab

Code: Select all

r := Session.Send("window","DELETE") ; use this for closing tab
if r.error
	msgbox, % "found error" json.dump(r)
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

User avatar
hotcheesesoup
Posts: 34
Joined: 08 May 2022, 01:41

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by hotcheesesoup » 07 Nov 2022, 01:01

Xeo786 wrote: why do you keep doing ActiveTab() 16 ms :?:
Basically within the timer I'm using InsertAdjacentHTML to insert buttons and data into the page, hide unnecessary fields/buttons, update CSS, etc. When clicked, the buttons toggle a variable to 1, and AHK is acting like an EventListener. It can then run other local programs/tools/AHK scripts on the computer, save data outside the browser session to an .ini file, etc. Checking every 16ms (~60fps) ensures the buttons are quickly added to the page, and the EventListening happens quickly as well.
Xeo786 wrote: this.GetTabs() provides all the tabs Window handle id but does not specify which window is an active window but JSON list this.Detail() on other hand tells what window handle id is active tab, 16 ms is too little delay, I do not know how Json list from debuggerurl get updated after closing a tab manually

I have never faced issue with closing tab, you should debug something like this for closing tab

Code: Select all

r := Session.Send("window","DELETE") ; use this for closing tab
if r.error
	msgbox, % "found error" json.dump(r)
Perhaps I will try dropping the rate to 32ms and see if that makes a difference. I will try debugging this way too when I have a chance and see what I find out.

Thanks for your help!

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 23 Nov 2022, 07:29

Full page Screenshot Trick

It's been hard for programmers to capture full-page screenshots, Thanks to CDP Rufaydium just got Session.CaptureFullSizeScreenShot(location) method that can take full page scrolled to the end screenshot! and it's very fast.

The following example needs latest Rufaydium.

Code: Select all

#include Rufaydium.ahk 
chrome:= new Rufaydium()
Session := chrome.NewSession()
Session.Maximize()
Session.url := "https://www.autohotkey.com/boards/viewforum.php?f=6"
location := A_Desktop "\www.autohotkey.com.png"
Session.CaptureFullSizeScreenShot(location)
Session.Quit()
chrome.Driver.Exit()
run, % location
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

thaihoa3189
Posts: 35
Joined: 23 Mar 2022, 22:10

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by thaihoa3189 » 23 Nov 2022, 21:50

Hello every body, i cant run the function Getting Existing Sessions.
I opened the page: https://github.com/Xeo786/Rufaydium-Webdriver
and then i run my code but it didnt work all the times

Here's my code:

Code: Select all

#Include Rufaydium.ahk

     Chrome := new Rufaydium("chromedriver.exe")
     ABC := Chrome.getSessionByUrl("https://github.com/Xeo786/Rufaydium-Webdriver")

     if !(IsObject(ABC))
     {
	     MsgBox Cant connect
	     ExitApp
     }

     ABC .CDP.evaluate("alert('Hello')")

     Chrome.Driver.Exit()
     return
[Mod edit: Replaced b tags with [code][/code] tags.]

Help me please

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 24 Nov 2022, 00:32

thaihoa3189 wrote:
23 Nov 2022, 21:50
Hello every body, i cant run the function Getting Existing Sessions.
I opened the page: https://github.com/Xeo786/Rufaydium-Webdriver
and then i run my code but it didnt work all the times

Here's my code:

Code: Select all

#Include Rufaydium.ahk

     Chrome := new Rufaydium("chromedriver.exe")
     ABC := Chrome.getSessionByUrl("https://github.com/Xeo786/Rufaydium-Webdriver")

     if !(IsObject(ABC))
     {
	     MsgBox Cant connect
	     ExitApp
     }

     ABC.CDP.evaluate("alert('Hello')")

     Chrome.Driver.Exit()
     return
[Mod edit: Replaced b tags with [code][/code] tags.]

Help me please
You need to understand the basic concept of how Webdriver works, *driver.exe is connected to every session that is created until that driver is closed, you are using Chrome.Driver.Exit() which closes the driver process and all the Session/Browser windows/tabs has been disconnected, You only need to use Chrome.Driver.Exit() when you do not want to get the existing session anymore,

you can use Session.ExecuteSync("alert('Hello')") instead ABC.CDP.evaluate("alert('Hello')"), and
you can return value from the console something like Session.ExecuteSync("return document.documentElement.scrollHeight")
you can also pass data to the chrome console something like this,

Code: Select all

Session := Chrome.getSessionByUrl("https://github.com/Xeo786/Rufaydium-Webdriver") ; it will  get existing window if there is a session with that URL and driver is not exited
var1 := "abcd"
var2 := 1200
Var3 := "xyz`n`n123"
JS =
( 
alert('var1 ' + arguments[0]);
alert('var2 ' + arguments[1]);
alert('var3 ' + arguments[2])
)
Session.ExecuteSync(JS,var1,var2,var3)
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

thaihoa3189
Posts: 35
Joined: 23 Mar 2022, 22:10

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by thaihoa3189 » 24 Nov 2022, 03:54

@Xeo786 I deleted the Chrome.Driver.Exit() in my code and replaced ABC.CDP.evaluate("alert('Hello')") with Session.ExecuteSync("alert('Hello')").
But it's still doesnt work. Cant you show the example code to Get Existing Sessions please ?

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 24 Nov 2022, 05:31

thaihoa3189 wrote:
24 Nov 2022, 03:54
@Xeo786 I deleted the Chrome.Driver.Exit() in my code and replaced ABC.CDP.evaluate("alert('Hello')") with Session.ExecuteSync("alert('Hello')").
But it's still doesnt work. Cant you show the example code to Get Existing Sessions please ?
1) Webdriver can only access session that is created through webdriver.
2) one can attach Webpage (even not created by Webdriver) to webdriver, it's complicated and not implemented to Rufaydium because that would also need the Browser to run in debugging mode.
3) Webdriver Runs Browser with a random debugging port, for security reasons, Running a webbrowser with the active debugging port is not a good idea.

Chrome.getSessionByUrl(URL) gets the existing session. if there is no Webdriver session with the URL in question it will return empty, you can create a session using Session.NewSession(),

Code: Select all

Chrome := new Rufaydium() ; chromedriver.exe is default driver 
url := "https://github.com/Xeo786/Rufaydium-Webdriver"
Session := Chrome.getSessionByUrl(url) ; it will  get existing window if there is a session with that URL and driver is not exited

if !isobject(Session) ; if there is no session Class object
{
	Session := chrome.NewSession(url) ; then create a new session
	Session.url := url ; and navigate to url and wait until page is loaded
}

var1 := "abcd"
var2 := 1200
Var3 := "xyz`n`n123"
JS =
( 
alert('var1 ' + arguments[0]);
alert('var2 ' + arguments[1]);
alert('var3 ' + arguments[2])
)
Session.ExecuteSync(JS,var1,var2,var3)
Run above code first time: it will create a session and run JS to navigated page
Run above code Second time: it will not create session, it will access the existing session and run JS over that page

You should read How to use, how you create tabs and windows within one session.
Last edited by Xeo786 on 24 Nov 2022, 06:20, edited 1 time in total.
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

thaihoa3189
Posts: 35
Joined: 23 Mar 2022, 22:10

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by thaihoa3189 » 24 Nov 2022, 06:04

@Xeo786 thank you

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by automater » 28 Nov 2022, 09:06

A little help please. I'm trying to click on a button 'Run report' but it's not working. I tried doing this directly in the browser console using JS (per Joe Gline's tutorial) but it's not working their either. Not sure what I'm doing wrong.

In the browser console, I tried this JS that I learned from Joe Glines' video to no avail:

Code: Select all

document.querySelector('.sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq').Click()
In Visual Studio I tried this also to no avail:

Code: Select all

Page.querySelector(".sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq").Click()
The driver is loading and navigating to the website but the click isn't working.

Additional info:
When I right-click the 'Run report' button and click inspect, here is the element info:

Code: Select all

<button id="J_Button_NORMAL_ENABLED" data-eventid="J_Button_NORMAL_ENABLED" data-ccx-e2e-id="aac-button-J_Button_NORMAL_ENABLED" class="sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq" type="button">Run report</button>
My entire script thus far:

Code: Select all

#include Rufaydium.ahk


Chrome := new Rufaydium("chromedriver.exe")
Chrome.capabilities.setUserProfile("Profile 2")
Page := Chrome.NewSession()
Page.URL := "hidden for privacy"
Page.querySelector(".sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq").Click()

F12::
Chrome.QuitAllSessions() ; close all session 
;Chrome.Driver.Exit() ; then exits driver
return
Also, if anyone is willing to mentor via a more instant-chat platform, I'd be happy to pay a small fee per question as I think it will help me learn faster.

Image
Last edited by BoBo on 28 Nov 2022, 09:15, edited 1 time in total.
Reason: Image added as requested by the OP.

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 28 Nov 2022, 10:14

automater wrote:
28 Nov 2022, 09:06

Code: Select all

<button id="J_Button_NORMAL_ENABLED" data-eventid="J_Button_NORMAL_ENABLED" data-ccx-e2e-id="aac-button-J_Button_NORMAL_ENABLED" class="sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq" type="button">Run report</button>
This element consist two classes "sc-storm-ui-20024493__sc-d3w8xm-0" and "EkIZt sc-plVjM kFjCZq" separated by space
if you try following in console you will see results

Code: Select all

document.querySelector('.sc-storm-ui-20024493__sc-d3w8xm-0.EkIZt sc-plVjM kFjCZq')
same will work for Rufaydium
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.0 (no selenium/websocket)

Post by automater » 28 Nov 2022, 19:30

usafer wrote:
29 Jul 2022, 02:43
@Xeo786, thanks.
It looks like a step in correct direction.

Now I see new Chrome' window but default URL (so script doesn't opens link).

And look what I see: (Screenshot_26.png attachement)

In this case code what used is:

Code: Select all

#include Rufaydium.ahk 
Chrome := new Rufaydium() 
Chrome.capabilities.setUserProfile() ; it will load chrome with default user 

; default userDataDir location
userDataDir := "D:\Users\" A_UserName "/AppData/Local/Google/Chrome/User Data" ; you can change location here 
Chrome.capabilities.setUserProfile("Default",userDataDir) ; in case userDataDir  is something else in your windows 

Page := Chrome.NewSession()

; Chromeapp := A_ProgramFiles "\Google\Chrome\Application\chrome.exe"
; Page := Chrome.NewSession(Chromeapp) ; in case executable location is changed for you

Page.url := "https://www.autohotkey.com/boards" ; this navigate just line page.navigate(url)
Msgbox, % Page.Title "`n" Page.URL 
return
If I commenting the

Code: Select all

Chrome.capabilities.setUserProfile("Default",userDataDir) ; in case userDataDir  is something else in your windows 
I see all as was before.

If I create new profile and choose it like:

Code: Select all

Chrome.capabilities.setUserProfile("Profile 2",userDataDir)
I see same (busy profile message)

OK, then I thought to use maybe portable chrome?
I've choosed portableapps with chrome beta and changed the code:

Code: Select all

#include Rufaydium.ahk 
Chrome := new Rufaydium() 
userDataDir := "C:\PortableApps\GoogleChromePortableBeta\Data\profile" ; you can change location here 
Chrome.capabilities.setUserProfile("Profile 2",userDataDir) ; in case userDataDir  is something else in your windows 

Page := Chrome.NewSession()

Chromeapp := "C:\PortableApps\GoogleChromePortableBeta\App\Chrome-bin\chrome.exe"
Page := Chrome.NewSession(Chromeapp) ; in case executable location is changed for you

Page.url := "https://www.autohotkey.com/boards" ; this navigate just line page.navigate(url)
Msgbox, % Page.Title "`n" Page.URL 
return
...and that helps!

BUT! I still get that error what I've show you before (screenshot25.png attachement). Why?

And maybe an idea:
I've test it using my laptop and all working fine.
Not sure, but... Is any win11 users here? Maybe win11 doesn't allows to operate with Chrome profile folders?
For anyone getting this error, changing the directory from C to D and passing the User Dir didn't work for me. My browser was opening then showing me the 'DevToolsActivePort file doesn't exist' error. I'm not sure whether I was in chromedriver or my regular chrome installation but out of curiousity I clicked on the ellipsis > Help > About to see what version of chrome I had - then it automatically started updating. After that happened, I tried my script again and I stopped getting the issue - it works now! Again, I didn't expect it to work so I wasn't paying close attention - not sure whether it's chromedriver or my regular chrome that updated but play around and see. @Xeo786 - tagging you in case someone else asks about this.

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by automater » 28 Nov 2022, 19:34

Xeo786 wrote:
28 Nov 2022, 10:14
automater wrote:
28 Nov 2022, 09:06

Code: Select all

<button id="J_Button_NORMAL_ENABLED" data-eventid="J_Button_NORMAL_ENABLED" data-ccx-e2e-id="aac-button-J_Button_NORMAL_ENABLED" class="sc-storm-ui-20024493__sc-d3w8xm-0 EkIZt sc-plVjM kFjCZq" type="button">Run report</button>
This element consist two classes "sc-storm-ui-20024493__sc-d3w8xm-0" and "EkIZt sc-plVjM kFjCZq" separated by space
if you try following in console you will see results

Code: Select all

document.querySelector('.sc-storm-ui-20024493__sc-d3w8xm-0.EkIZt sc-plVjM kFjCZq')
same will work for Rufaydium
OMG this worked! Amazing! I'm sooo excited. Automation is so much fun! Thanks @Xeo786 - you're the man!

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by automater » 28 Nov 2022, 21:47

Can anyone help me figure out how to select an element by aria-label?

In the Dev Console, this works perfectly:

Code: Select all

document.querySelector('[aria-label="Choose Saturday, September 24, 2022 as your start date."]').click()
This is giving an error saying quotes are missing:

Code: Select all

Page.querySelector("[aria-label="Choose Saturday, September 24, 2022 as your start date."]").click()
None of these work either; they're just not selecting the element when the time comes:

Code: Select all

Page.querySelector(""[aria-label="Choose Saturday, September 24, 2022 as your start date."]"").click()

Code: Select all

Page.querySelector("""[aria-label=""Choose Saturday, September 24, 2022 as your start date.""]""").click()
Thanks for any help.

User avatar
boiler
Posts: 16772
Joined: 21 Dec 2014, 02:44

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by boiler » 29 Nov 2022, 00:03

This seems like what you're going for:

Code: Select all

Page.querySelector("'[aria-label=""Choose Saturday, September 24, 2022 as your start date.""]'").click()

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by Xeo786 » 29 Nov 2022, 00:42

boiler wrote:
29 Nov 2022, 00:03
This seems like what you're going for:

Code: Select all

Page.querySelector("'[aria-label=""Choose Saturday, September 24, 2022 as your start date.""]'").click()
I would do something like this

Code: Select all

Page.querySelector("[aria-label='Choose Saturday, September 24, 2022 as your start date.']").click()
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by automater » 29 Nov 2022, 06:04

Xeo786 wrote:
29 Nov 2022, 00:42
boiler wrote:
29 Nov 2022, 00:03
This seems like what you're going for:

Code: Select all

Page.querySelector("'[aria-label=""Choose Saturday, September 24, 2022 as your start date.""]'").click()
I would do something like this

Code: Select all

Page.querySelector("[aria-label='Choose Saturday, September 24, 2022 as your start date.']").click()
@boiler and @Xeo786 thank you both very much for the quick help. I tried Xeo's suggestion first and it worked!

automater
Posts: 20
Joined: 01 Jul 2022, 08:51

Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)

Post by automater » 29 Nov 2022, 07:19

I feel bad for asking so many questions but I'm stuck again :|

I'm trying to set the value of a box using AHK variables but the % signs are breaking my code:

Code: Select all

accName := "Nike"
reportName := accName " ST Report"
Page.querySelector(".sc-pcZJD.iNHvZE").value = %reportName%
Also, I don't have the foundational web-page knowledge to use Rufaydium to its fullest. The browser contols I understand (reloads, new tabs, print, etc). Specifically, I don't know what the heck are classes, divs, spans, IDs, xpaths, paths, etc. The problem is that I don't even know what sub-field of knowledge I need to learn is called. My question: What language and subfield is this so I can understand Rufaydium fastest? From a few Google searches, is it something like 'manipulating documents' or 'controlling HTML'? Please point me in the right direction. And please don't be top level like 'you need to learn HTML' instead, kindly point me to the name of the subset of knowledge I need for understanding the web-page code.

Post Reply

Return to “Scripts and Functions (v1)”