Rufaydium WebDriver 1.7.2 (no selenium/websocket)
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Is possible to select a canvas inside an Iframe? I need to perform a click using javascript but I'm not sure if is possible. Changing frame level and the function Evaluate to send javascript code doesn't seem to work together.
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Sure can you just need to be in the correct iFrame.cristalgrip wrote: ↑13 Nov 2023, 15:17Is possible to select a canvas inside an Iframe? I need to perform a click using javascript but I'm not sure if is possible. Changing frame level and the function Evaluate to send javascript code doesn't seem to work together.
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Can you be more specific or do an example?Xtra wrote: ↑14 Nov 2023, 01:25Sure can you just need to be in the correct iFrame.cristalgrip wrote: ↑13 Nov 2023, 15:17Is possible to select a canvas inside an Iframe? I need to perform a click using javascript but I'm not sure if is possible. Changing frame level and the function Evaluate to send javascript code doesn't seem to work together.
One crucial thing I forgot to mention is that I'm talking about an Cross-origin iframe, so the same-origin policy doesn't allow to run any javascript if I'm not alredy "inside" the iframe.
Thx!
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
If you can get a reference to the element you are trying to click and then Rufaydium clicks do not work, there is nothing you can do. Just try to click without using any javascript.
I dont have an example that you would have access to.
Your options:
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#cross-origin_script_api_access
I dont have an example that you would have access to.
Your options:
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#cross-origin_script_api_access
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Sorry I just found out what I was missing. My problem is that "Page.ExecuteSync()" is not very documented.
-
- Posts: 16
- Joined: 19 Oct 2022, 15:30
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
separateattention wrote: ↑18 Aug 2023, 14:07That's my problem, the browser IS in headless mode, but still asking for "wkhtmltopdf", any idea?Xeo786 wrote: ↑18 Aug 2023, 11:27if browser is not in headless mode Rufaydium will try to use whtmltopdf taht is 3rd party toll that converts html to pdf using commandline and method will be used if whtmltopdf is installedseparateattention wrote: ↑17 Aug 2023, 14:50@Xeo786 sorry but cant still figure this outseparateattention wrote: ↑29 Jun 2023, 10:37Hey Xeo, can you help me with this code:
Even with Chrome.capabilities.addArg("--headless") and Chrome.capabilities.HeadlessMode := true, Im still get a windows that saysCode: Select all
Driver := "some directory" Chrome := new Rufaydium(Driver) Chrome.capabilities.addArg("--headless") Chrome.capabilities.HeadlessMode := true Chrome.capabilities.setUserProfile("Default") Page := Chrome.NewSession() Page.Navigate("https:...") Page.print("C:\Users\...\Downloads\test.pdf",PrintOptions.A4_Default) return
Any idea?User is required to install "wkhtmltopdf" in order to enable pdf printing without headless mode
@Xeo786 hey, some insight about this, commenting out this part of the code and removing the if if this.Capabilities.HeadlessMode in the main Rufaydium.ahk seems to fix the problem and now I can print in headless mode.
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
The latest version of Microsoft Edge is 121.0.2277.83.
With this version, Rafaydium is reporting an error ("cannot find msedge binary") with the new 'Microsoft Edge WebDriver.' I've even tried downloading it manually, but the issue persists.
With this version, Rafaydium is reporting an error ("cannot find msedge binary") with the new 'Microsoft Edge WebDriver.' I've even tried downloading it manually, but the issue persists.
-
- Posts: 16
- Joined: 19 Oct 2022, 15:30
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
You can fix that pointing to the exe:cristalgrip wrote: ↑28 Jan 2024, 08:35The latest version of Microsoft Edge is 121.0.2277.83.
With this version, Rafaydium is reporting an error ("cannot find msedge binary") with the new 'Microsoft Edge WebDriver.' I've even tried downloading it manually, but the issue persists.
Code: Select all
WB := MSEdge.NewSession("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe")
Code: Select all
#Include Rufaydium.ahk
Driver:= "C:\Users\" A_UserName "\Documents\msedgedriver.exe"
MSEdge := new Rufaydium(Driver)
MSEdge.capabilities.addArg("--disable-dev-shm-usage")
MSEdge.capabilities.setUserProfile("Default") ; this load profile 1 according to image
WB := MSEdge.NewSession("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe")
WB.Navigate("http://...")
return
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
You are right! Absolutely perfect. Thank you very much! It's strange because when generating the new webdriver (for the new version of Edge), Rafaydium indicates the correct path.
I am really grateful to you.
I am really grateful to you.
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
There is a way to get the PID of Browser launched by Rufaydium WebDriver?
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I've been exploring a solution in Rafaydium.ahk that involves matching the (PID) of "msedgedriver.exe" with the Parent PID of each instance of "msedge.exe". If they correspond, then the PID of msedge.exe is the one created by that particular webdriver.cristalgrip wrote: ↑27 Feb 2024, 03:38There is a way to get the PID of Browser launched by Rufaydium WebDriver?
However, I've encountered a significant drawback in this approach. If the browser or the webdriver are not closed correctly, the old session remains open with the same PID of "msedgedriver.exe". As a result, the PID returned is incorrect.
Code: Select all
.....
Class Session
{
__new(i)
{
this.id := i.id
this.Address := i.address
this.debuggerAddress := i.debuggerAddress
this.Build := i.Build
this.name := i.name
if i.websocketurl
this.websocketurl := i.websocketurl
this.currentTab := this.Send("window","GET")
switch i.name
{
case "chromedriver" :
this.CDP := new CDP(this.Address)
case "msedgedriver" :
this.CDP := new CDP(this.Address)
for proc in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process WHERE Name = 'msedge.exe'")
{
ParentProcessId:=proc.ParentProcessId
processid:=proc.processid
DriverPID:= i.DriverPID
if(DriverPID=ParentProcessId){
msgbox, %DriverPID% - %ParentProcessId% ---- %processid%
}
}
case "operadriver" :
this.CDP := new CDP(this.Address)
case "geckodriver" :
for proc in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process WHERE Name = 'firefox.exe'")
if ( proc.ParentProcessId = i.DriverPID)
for proc2 in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process WHERE Name = 'firefox.exe'")
if ( proc2.ParentProcessId = proc.processid)
{
this.BroswerPID := proc2.processid
break
}
}
}
......
Re : Rufaydium WebDriver 1.7.2 (셀레늄/웹소켓 없음)
[인용:JerryMaguire post_id=518848 time=1682261456 user_id=156994]
[인용:JerryMaguire post_id=518509 time=1682078835 user_id=156994]
@Xeo786속
팝업창의 확인 버튼을 클릭하고 Autohotkey의 WinExist(WinTitle)를 사용하여 창을 활성화하고 Send {Enter} 또는 Send {Space}를 사용하여 클릭하는 솔루션을 찾았습니다.
확인 버튼
[/인용]
참조용 코드를 제공할 수 있습니다.
[/인용]
how can use session.alret("accept") ?? plz show me sample
[Mod edit: Removed big, empty code box. Not even sure what else was intended here so leaving as-is.]
[인용:JerryMaguire post_id=518509 time=1682078835 user_id=156994]
@Xeo786속
팝업창의 확인 버튼을 클릭하고 Autohotkey의 WinExist(WinTitle)를 사용하여 창을 활성화하고 Send {Enter} 또는 Send {Space}를 사용하여 클릭하는 솔루션을 찾았습니다.
확인 버튼
[/인용]
참조용 코드를 제공할 수 있습니다.
[/인용]
how can use session.alret("accept") ?? plz show me sample
[Mod edit: Removed big, empty code box. Not even sure what else was intended here so leaving as-is.]
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
example
>>>>a confirmation prompt window appears in Chrome
question
When I click the button through the code above, a confirmation prompt window appears in Chrome, but there is no way to click it.
Is there a separate way to click on the prompt window in Rufaydium? If so, please provide an example code.
Session.alert("accept") <<< use this??? but how can use it? plz help me
[Mod edit: Moved Codebox tags to be around the code, not at the top of the post.]
Code: Select all
#Include Rufaydium-Webdriver-main\Rufaydium.ahk
Chrome := new Rufaydium()
Page := Chrome.NewSession()
url:="https://whm.ala-888.com/auth/login"
Confirm := Page.querySelectorAll(".btn.btn-info.approve")[1] ;
Confirm.Click()
question
When I click the button through the code above, a confirmation prompt window appears in Chrome, but there is no way to click it.
Is there a separate way to click on the prompt window in Rufaydium? If so, please provide an example code.
Session.alert("accept") <<< use this??? but how can use it? plz help me
[Mod edit: Moved Codebox tags to be around the code, not at the top of the post.]
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
those are user prompts by default they are dismiss so you can use 'Session.alert("accept")' session represents session instance which 'page' in your case.nonchita wrote: ↑04 Apr 2024, 19:41example>>>>a confirmation prompt window appears in ChromeCode: Select all
#Include Rufaydium-Webdriver-main\Rufaydium.ahk Chrome := new Rufaydium() Page := Chrome.NewSession() url:="https://whm.ala-888.com/auth/login" Confirm := Page.querySelectorAll(".btn.btn-info.approve")[1] ; Confirm.Click()
question
When I click the button through the code above, a confirmation prompt window appears in Chrome, but there is no way to click it.
Is there a separate way to click on the prompt window in Rufaydium? If so, please provide an example code.
Session.alert("accept") <<< use this??? but how can use it? plz help me
[Mod edit: Moved Codebox tags to be around the code, not at the top of the post.]
Code: Select all
#Include Rufaydium-Webdriver-main\Rufaydium.ahk
Chrome := new Rufaydium()
Page := Chrome.NewSession()
url:="https://whm.ala-888.com/auth/login"
Confirm := Page.querySelectorAll(".btn.btn-info.approve")[1] ;
Confirm.Click()
Page .alert("accept")
"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)
Yes, this solves the problem, but on the example site, a user prompt appears once more and if you use the accept command twice, sometimes it works and sometimes it doesn't. There are cases where the first user prompt is unconditionally clicked, but the second one is not clicked. Do you have any good ideas?
-
- Posts: 1
- Joined: 14 Jun 2024, 08:20
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
This library is insane, awesome work!
This is exactly what I'm looking for. Does anybody happen to have an idea how to implement this?Xeo786 wrote: ↑24 Nov 2022, 05:312) 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.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 ?
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Hello, I want to use the function of togle device toolbar in Chrome's dev tool, but there is no response at all. Below is the script I tested. I would appreciate it if you could review it once
Code: Select all
driver = %A_ScriptDir%\chromedriver.exe
Chrome := new Rufaydium(driver,"--port=8001")
Chrome.capabilities.IncognitoMode := true
Page := Chrome.NewSession()
Page.Navigate("https://www.naver.com")
deviceMetrics := ["360","460","1","true"]
Page.CDP.call("Emulation.setDeviceMetricsOverride", deviceMetrics)
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
No response just because me and AHK v1 was doing the same thing when facing error.
setDeviceMetricsOverride need object and each property should be define with case-sense.
Code: Select all
deviceMetrics := {"width":360,"height":460,"deviceScaleFactor":1,"mobile":json.true}
"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 problem is in the Method Send()Xtra wrote: ↑07 Nov 2023, 14:01Reporting a possible issue:
When getting innerText and the text is 0 (zero) the returned value is blank.
I have tried every method to get it to work. CDP, ExecuteSync, querySelector etc.
In Chrome dev tools console it works like expected.
It may be caused by AHK treating 0 as false aka blank.
Code: Select all
send(url,Method,Payload:= 0,WaitForResponse:=1)
{
if !instr(url,"HTTP")
url := this.address "/" url
if (Payload = 0) and (Method = "POST")
Payload := Json.null
try r := Json.load(Rufaydium.Request(url,Method,Payload,WaitForResponse)).value ; Thanks to GeekDude for his awesome cJson.ahk
if(r.error = "chrome not reachable") ; incase someone close browser manually but session is not closed for driver
this.quit() ; so we close session for driver at cost of one time response wait lag
if (r || r=0) ; This is AHK v1 we need to check for 0 so it can be returned.
return r
}
Could just return r without the checks?
- Sabestian Caine
- Posts: 550
- Joined: 12 Apr 2015, 03:53
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
friends i am facing a problem regarding edge browser...please look once this link in which i have explained by issue in detail-
viewtopic.php?p=583840#p583840
viewtopic.php?p=583840#p583840
I don't normally code as I don't code normally.