Rufaydium WebDriver 1.7.2 (no selenium/websocket)
-
- Posts: 19
- Joined: 26 Aug 2022, 07:18
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Is there a way to disable headless mode without starting a new browser object/ restarting the script?
I want to be able to fix login trouble / captcha if they occur then hide the window again, but keep headless mode as the default since errors like captcha are rare
I want to be able to fix login trouble / captcha if they occur then hide the window again, but keep headless mode as the default since errors like captcha are rare
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
First: Thanks for your efforts to give us Rufaydium, Xeo786!
Question: I want to detect if an object has been clicked and if so, trigger an action. E.g. a message box "Element was clicked". Can this also be done with Rufaydium? I have not found a solution yet. Any advice would be greatly appreciated.
Question: I want to detect if an object has been clicked and if so, trigger an action. E.g. a message box "Element was clicked". Can this also be done with Rufaydium? I have not found a solution yet. Any advice would be greatly appreciated.
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I solved it myself:Tremzoff wrote: ↑17 Mar 2023, 16:18First: Thanks for your efforts to give us Rufaydium, Xeo786!
Question: I want to detect if an object has been clicked and if so, trigger an action. E.g. a message box "Element was clicked". Can this also be done with Rufaydium? I have not found a solution yet. Any advice would be greatly appreciated.
Code: Select all
Session.CDP.Evaluate("let value = 'no click'; const path = document.querySelector(""YOUR SELECTOR""); path.onclick = function breakLoop(){ value = 'clicked'; }")
Loop {
if (Session.ExecuteSync("return value")="clicked")
{
msgbox, Clicked!
Session.ExecuteSync("value='kein klick'")
}
Sleep 100
}
I hope this will be helpful for somebody
-
- Posts: 16
- Joined: 05 Mar 2023, 11:17
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I use Vivaaldi Browser, session.NewTab() is working, but tab focus not work, SwitchTab(2) not work
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I want to see Tab idJerryMaguire wrote: ↑26 Mar 2023, 06:51I use Vivaaldi Browser, session.NewTab() is working, but tab focus not work, SwitchTab(2) not work
Code: Select all
; Session.SwitchTab(1) ; if this not working
session.NewTab()
msgbox, % Session.currentTab ; this is how you get Tab id
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
You could also use Session.ExecuteSync(JS) to pass any JS function
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Can Rufaydium pass the Cloudflare bot checking?
check this site:https://nowsecure.nl//
chrome can't visit it if starting with chromedriver.exe.
check this site:https://nowsecure.nl//
chrome can't visit it if starting with chromedriver.exe.
-
- Posts: 16
- Joined: 05 Mar 2023, 11:17
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I want to open two browsers (Chrome and Brave) in one .ahk via Rufaydium WebDriver, is it possible?
In fact, I want to open 2 Chromium (Chrome and Brave) and 1 MSEdge, but currently only Chrome and MSEdge can be successfully opened
Chrome and MSEdge is working
This is my code,Chrome and Brave not working
In fact, I want to open 2 Chromium (Chrome and Brave) and 1 MSEdge, but currently only Chrome and MSEdge can be successfully opened
Chrome and MSEdge is working
Code: Select all
#Include D:\Rufaydium-Webdriver\Rufaydium.ahk
MyProfileDir := "E:\Profile_Dir\"
Chrome := new Rufaydium()
Chrome.capabilities.setUserProfile("Default") ; can use Default user
Chrome.capabilities.setUserProfile("Profile 1", MyProfileDir) ; for Brave
Session1 := Chrome.NewSession()
Chrome.capabilities.Addextensions(extensionloaction) ; will load extensions
Chrome.capabilities.AddexcludeSwitches("enable-automation") ; will load Chrome without default args
Chrome.capabilities.DebugPort(9255) ; will change port for debuggerAddress
Session1.Navigate("http://www.google.com.tw/")
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").Focus()
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").SendKey("Rufaydium")
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.FPdoLc.lJ9FBc > center > input.gNO89b").Click()
Session1.NewTab()
Session1.Navigate("https://www.autohotkey.com/")
Chrome.Driver.Exit()
MSEdge:= new Rufaydium("msedgedriver") ;,"--port=9516")
;MSEdge:= new Rufaydium("msedgedriver.exe","--port=9516")
MSEdge.capabilities.addArg("--no-sandbox")
MSEdge.capabilities.addArg("--disable-dev-shm-usage")
MSEdge.capabilities.setUserProfile("Default")
;MSEdge.capabilities.Addextensions(extensionloaction) ; will load extensions
;MSEdge.capabilities.AddexcludeSwitches("enable-automation") ; will load Chrome without default args
;MSEdge.capabilities.DebugPort(9256) ; will change port for debuggerAddress
Page := MSEdge.NewSession() ; to create session
Page.url := "https://www.autohotkey.com/boards/" ; to navigate url
MSEdge.Driver.Exit()
ExitApp
Code: Select all
#Include D:\Rufaydium-Webdriver\Rufaydium.ahk
MyProfileDir := "D:\Profile_Dir\"
Chrome := new Rufaydium()
Chrome.capabilities.setUserProfile("Default") ; can use Default user
Chrome.capabilities.setUserProfile("Profile 1", MyProfileDir) ; for Brave
Session1 := Chrome.NewSession()
Chrome.capabilities.Addextensions(extensionloaction) ; will load extensions
Chrome.capabilities.AddexcludeSwitches("enable-automation") ; will load Chrome without default args
Chrome.capabilities.DebugPort(9255) ; will change port for debuggerAddress
Session1.Navigate("http://www.google.com.tw/")
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").Focus()
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").SendKey("Rufaydium")
Session1.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.FPdoLc.lJ9FBc > center > input.gNO89b").Click()
Session1.NewTab()
Session1.Navigate("https://www.autohotkey.com/")
Chrome.Driver.Exit()
Brave:= new Rufaydium("chromedriver.exe")
;Brave:= new Rufaydium("Bravedriver.exe","--port=9516")
Brave.capabilities.addArg("--no-sandbox")
Brave.capabilities.addArg("--disable-dev-shm-usage")
Brave.capabilities.setUserProfile("Profile2")
Brave.capabilities.Addextensions(extensionloaction) ; will load extensions
Brave.capabilities.AddexcludeSwitches("enable-automation") ; will load Chrome without default args
;Brave.capabilities.DebugPort(9256) ; will change port for debuggerAddress
Page := Brave.NewSession("C:\Users\Conan_PC\AppData\Local\BraveSoftware\Brave-Browser\Application\brave.exe") ; to create session
Page.url := "https://www.autohotkey.com/boards/" ; to navigate url
Brave.Driver.Exit()
ExitApp
-
- Posts: 16
- Joined: 05 Mar 2023, 11:17
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
@Xeo786
Regarding Chrome.capabilities.Addextensions(extensionloaction), I just found out that my understanding of "extensionloaction" was wrong
Regarding Chrome.capabilities.Addextensions(extensionloaction), I just found out that my understanding of "extensionloaction" was wrong
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
yes heremagusneo wrote: ↑28 Mar 2023, 11:17Can Rufaydium pass the Cloudflare bot checking?
check this site:https://nowsecure.nl//
chrome can't visit it if starting with chromedriver.exe.
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
the issue is Brave uses chromedriver, we cannot rename driver.exe because I didn't wrote Rufaydium that way.JerryMaguire wrote: ↑28 Mar 2023, 11:34I want to open two browsers (Chrome and Brave) in one .ahk via Rufaydium WebDriver, is it possible?
In fact, I want to open 2 Chromium (Chrome and Brave) and 1 MSEdge, but currently only Chrome and MSEdge can be successfully opened
yes, You need two chromedriver.exe from different location.
Code: Select all
#include Rufaydium.ahk
ChromeF := A_ScriptDir "\ChromeDriver"
if !FileExist(ChromeF)
FileCreateDir, % ChromeF
BraveF := A_ScriptDir "\BraveDriver"
if !FileExist(BraveF)
FileCreateDir, % BraveF
Chrome := new Rufaydium(ChromeF "\ChromeDriver.exe") ; default port 9515
ChromeSession := Chrome.NewSession()
Brave := new Rufaydium(BraveF "\ChromeDriver.exe","--port=9514")
BraveExe := "here put tyhe location of brave broswer executeabls"
BraveSession := Brave.NewSession(BraveExe)
but Brave is Chrome Based it uses chromedriver
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Thank you.It works like a charm.
Code: Select all
chrome.Capabilities.addArg("--disable-blink-features=AutomationControlled")
-
- Posts: 16
- Joined: 05 Mar 2023, 11:17
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
thank you so muchXeo786 wrote: ↑28 Mar 2023, 23:59the issue is Brave uses chromedriver, we cannot rename driver.exe because I didn't wrote Rufaydium that way.JerryMaguire wrote: ↑28 Mar 2023, 11:34I want to open two browsers (Chrome and Brave) in one .ahk via Rufaydium WebDriver, is it possible?
In fact, I want to open 2 Chromium (Chrome and Brave) and 1 MSEdge, but currently only Chrome and MSEdge can be successfully opened
yes, You need two chromedriver.exe from different location.You were able to run Edge with chrome because they got their own driver, both chromemium basedCode: Select all
#include Rufaydium.ahk ChromeF := A_ScriptDir "\ChromeDriver" if !FileExist(ChromeF) FileCreateDir, % ChromeF BraveF := A_ScriptDir "\BraveDriver" if !FileExist(BraveF) FileCreateDir, % BraveF Chrome := new Rufaydium(ChromeF "\ChromeDriver.exe") ; default port 9515 ChromeSession := Chrome.NewSession() Brave := new Rufaydium(BraveF "\ChromeDriver.exe","--port=9514") BraveExe := "here put tyhe location of brave broswer executeabls" BraveSession := Brave.NewSession(BraveExe)
but Brave is Chrome Based it uses chromedriver
Through your demonstration, which is also the most important part, plus the path of webdriver.exe, this part is something I have always wanted to do but couldn’t figure it out. I can let Chromium-based browsers use their own versions and open them in the same ahk multiple browsers
Here is my code, it works
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include D:\Rufaydium-Webdriver\Rufaydium.ahk
BraveProfileDir := "D:\Profile_Dir\Brave\User Data\"
MSEdgeProfileDir := "D:\Profile_Dir\Edge\User Data\"
ChromeBraveProfileDir := "D:\Profile_Dir\Chrome\User Data\"
IronProfileDir := "D:\Profile_Dir\SRWareIron\User Data\"
Brave_Driver_File := A_ScriptDir "\WebDriver\Brave"
Brave_Exe_File := "C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe"
Chrome_Driver_File := A_ScriptDir "\WebDriver\Chrome"
Iron_Driver_File := A_ScriptDir "\WebDriver\Iron"
Iron_Exe_File := "C:\Program Files\SRWare Iron (64-Bit)\chrome.exe"
Brave_Driver := new Rufaydium(Brave_Driver_File "\ChromeDriver.exe","--port=9514")
Brave_Driver.capabilities.setUserProfile("Default", BraveProfileDir) ; can use Default user
Brave_Session := Brave_Driver.NewSession(Brave_Exe_File)
Brave_Session.Navigate("http://www.google.com.tw/")
Brave_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").Focus()
Brave_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").SendKey("Rufaydium")
Brave_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.FPdoLc.lJ9FBc > center > input.gNO89b").Click()
Brave_Session.NewTab()
Brave_Session.Navigate("https://www.autohotkey.com/")
Chrome_Driver:= new Rufaydium()
Chrome_Driver.capabilities.setUserProfile("Default", ChromeBraveProfileDir)
Chrome_Session := Chrome_Driver.NewSession() ; to create session
Chrome_Session.url := "https://www.hinet.net" ; to navigate url
MSEdge_Driver:= new Rufaydium("msedgedriver") ;,"--port=9516")
MSEdge_Driver.capabilities.setUserProfile("Profile 3", MSEdgeProfileDir)
MSEdge_Session := MSEdge_Driver.NewSession() ; to create session
MSEdge_Session.url := "https://shopee.tw/" ; to navigate url
Iron_Driver := new Rufaydium(Iron_Driver_File "\ChromeDriver.exe","--port=9519")
Iron_Driver.capabilities.setUserProfile("Default", IronProfileDir) ; can use Default user
Iron_Session := Iron_Driver.NewSession(Iron_Exe_File)
Iron_Session.Navigate("http://www.google.com.tw/")
Iron_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").Focus()
Iron_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").SendKey("Rufaydium")
Iron_Session.querySelector("body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.FPdoLc.lJ9FBc > center > input.gNO89b").Click()
Iron_Session.NewTab()
Iron_Session.Navigate("https://www.autohotkey.com/")
ExitApp
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
btw I just noticed Extension location should be base64 So I made few changes in capabilities to conver exension path to base64 but still I am unable to create session with addextension, Error says cannot unzipJerryMaguire wrote: ↑28 Mar 2023, 22:22@Xeo786
Regarding Chrome.capabilities.Addextensions(extensionloaction), I just found out that my understanding of "extensionloaction" was wrong
Code: Select all
Chrome := new Rufaydium()
extension := "C:\Users\irfan.exportho\Desktop\ChatGPT\extension_1_1_0_0.crx"
Chrome.Capabilities.Addextensions(extension) ; << cause error for me may be I am not doing proper base64 or I do not know the correct formate
page := Chrome.NewSession()
page.url := "google.com"
Code: Select all
#include Rufaydium.ahk
Chrome := new Rufaydium()
UncomprassedExtFolder := a_desktop "\ChatGPT\chatgpt"
Chrome.Capabilities.AddCustomExtension(UncomprassedExtFolder) ; make sure you are pass folder not the extension
page := Chrome.NewSession()
page.url := "google.com"
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Hello Xeo786,
I pulled down your latest version. Since then I have an error that the current tab is no longer recognised by Chrome. Only the window that is active at the start is recognised. If I change the tab, the first recognised window remains active.
and old
I think it has something to do with this change.
Bert
I pulled down your latest version. Since then I have an error that the current tab is no longer recognised by Chrome. Only the window that is active at the start is recognised. If I change the tab, the first recognised window remains active.
Code: Select all
; new
if( this.name != "geckodriver" )
this.Switch(this.Detail()[1].id ) ; First id always Current Handle
Code: Select all
if( this.name != "geckodriver" )
this.Switch("CDwindow-" this.Detail()[1].id ) ; First id always Current Handle
I think it has something to do with this change.
Bert
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
following is for chrome 110+Milchmann wrote: ↑30 Mar 2023, 00:19Hello Xeo786,
I pulled down your latest version. Since then I have an error that the current tab is no longer recognised by Chrome. Only the window that is active at the start is recognised. If I change the tab, the first recognised window remains active.and oldCode: Select all
; new if( this.name != "geckodriver" ) this.Switch(this.Detail()[1].id ) ; First id always Current Handle
Code: Select all
if( this.name != "geckodriver" ) this.Switch("CDwindow-" this.Detail()[1].id ) ; First id always Current Handle
I think it has something to do with this change.
Bert
Code: Select all
if( this.name != "geckodriver" )
this.Switch(this.Detail()[1].id ) ; First id always Current Handle
Code: Select all
if( this.name != "geckodriver" )
this.Switch("CDwindow-" this.Detail()[1].id ) ; First id always Current Handle
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Thanks for the answer, but unfortunately it doesn't make me happy.
Would it perhaps be possible to document such changes in such a way that I only install the updated Rufaydium web driver when Chrome is greater than 110? Currently we still have version 110 here, and that's what I programmed the error into.
One possibility would be to check which version of the browser is currently being used and then it calls the correct code.
To be clear, I appreciate your work and am very happy that something like this has been created by you.
First of all, I go back to an earlier version of Rufaydium-Webdriver.
Bert
Would it perhaps be possible to document such changes in such a way that I only install the updated Rufaydium web driver when Chrome is greater than 110? Currently we still have version 110 here, and that's what I programmed the error into.
One possibility would be to check which version of the browser is currently being used and then it calls the correct code.
To be clear, I appreciate your work and am very happy that something like this has been created by you.
First of all, I go back to an earlier version of Rufaydium-Webdriver.
Bert
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
It wasn't chrome version it was driver version issue Driver version 110 ran my chrome 111 and I tested with both driver 111 and driver 110 issue has been fixedMilchmann wrote: ↑31 Mar 2023, 00:04Thanks for the answer, but unfortunately it doesn't make me happy.
Would it perhaps be possible to document such changes in such a way that I only install the updated Rufaydium web driver when Chrome is greater than 110? Currently we still have version 110 here, and that's what I programmed the error into.
One possibility would be to check which version of the browser is currently being used and then it calls the correct code.
To be clear, I appreciate your work and am very happy that something like this has been created by you.
First of all, I go back to an earlier version of Rufaydium-Webdriver.
Bert
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
How can Rufaydium visit https://chat.openai.com/?It always tell me to verify even with the following code
Code: Select all
chrome.Capabilities.addArg("--disable-blink-features=AutomationControlled")