Ok, let me try.
Thanks for your information
Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
@Xeo786
I try change my script with:
Chrome := new Rufaydium()
Session := Chrome.NewSession()
url := "https://nowsecure.nl"
Session.Navigate(url)
Session.Maximize()
sleep, 200
return
And the browser keep refresh and it fail with the undetected chromedriver.
I try change my script with:
Chrome := new Rufaydium()
Session := Chrome.NewSession()
url := "https://nowsecure.nl"
Session.Navigate(url)
Session.Maximize()
sleep, 200
return
And the browser keep refresh and it fail with the undetected chromedriver.
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
You cannot use RunDriver Class directly? it would work for early version but not work latest,MoUse_G wrote: ↑31 Jan 2023, 01:42Hi, @Xeo786, I didn't use a Settimeout.
Usually, to test undetected chromedriver from python, go to the link: https://nowsecure.nl
And here is the link for the undetected chromedriver python library: https://pypi.org/project/undetected-chromedriver/2.1.1/
This is my simple script to test undetected chromedriver with rufaydium:
Code: Select all
ChromeDriver := A_ScriptDir "\chromedriver.exe" Driver := new RunDriver(ChromeDriver) Chrome := new Rufaydium() Session := Chrome.NewSession() url := "https://nowsecure.nl" Session.Navigate(url) Session.Maximize() sleep, 200 return
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Code: Select all
Driver := new RunDriver(ChromeDriver)
1) make sure driver is not running kill driver (i.e. chromedriver) using taskmager. and try following code
Code: Select all
Chrome := new Rufaydium()
Session := Chrome.NewSession()
url := "https://nowsecure.nl"
Session.Navigate(url)
Session.Maximize()
sleep, 200
return
for webdriver detection, you should look my this post
"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)
I've tried but still can't get to the site: https://nowsecure.nl/
-
- Posts: 16
- Joined: 19 Oct 2022, 15:30
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
@Xeo786 any idea on how to interact with this kind of alert/prompt;
I've used "UserPrompt" and "Session.Alert" without luck.
I've used "UserPrompt" and "Session.Alert" without luck.
- Attachments
-
- snip.png (9.07 KiB) Viewed 5379 times
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Implement all these for webdriver detection, its possible to do it using Rufaydium.MoUse_G wrote: ↑31 Jan 2023, 04:49I've tried but still can't get to the site: https://nowsecure.nl/
"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)
By Setting UserPrompt you will define what should webdriver, its "ignore" by default so a user can handle it, so you need to change it "ignore",separateattention wrote: ↑31 Jan 2023, 14:37@Xeo786 any idea on how to interact with this kind of alert/prompt;
I've used "UserPrompt" and "Session.Alert" without luck.
Now use have to deal it by using manually or Session.Alert()
in your case you have send text to alert and then accept it
Code: Select all
Chrome := Rufaydium()
MsgBox, % "UserPrompt : " Chrome.capabilities.UserPrompt
Chrome.capabilities.UserPrompt := "ignore" ; driver will wait for user to deal with alert
Page := Chrome .NewSession
; now do something here for to alert appear
Page.alert("Send","abc`t123") ; here send some text but using "`t" to emulate tab to get to the next edit box
Page.Alert("accept")
note: you have to make difference between Window alerts and Broswer alerts, both is created by Javascript, but window alert has window gui and broswer alerts are chrome UI based, Windows alert can be handle using AHK easily by winwait or winexist and contorl send and get
"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 for the adviceXeo786 wrote: ↑28 Jan 2023, 04:25no need to read complicated books, start with devtools console and elements and DOM itro, learn how to debug webpage using devtools how to use Java script to access element and data within elements then DOM methods, DOM Document & elements, but you need to there try examples in devtools console,songdg wrote: ↑28 Jan 2023, 02:26Thanks, any suggestion of books I should read for a crash course.Xeo786 wrote: ↑20 Jan 2023, 12:03You need to find that element from that particular website, to access it, You need to learn the basics of HTML and Javascript, Use the Devtools of the browser in question to read HTML tag elements class and id.songdg wrote: ↑20 Jan 2023, 11:26Thanks, it's quite easy to use. But when I use my local search engine (www.baidu.com), it dosen't work.
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I can't figure out a way to get an element based on the text it has written. Any help?
I tried to get a button based on his text ("Enter") with the aim to click on it but without success.
Element := Page.getElementsbyXpath("//*[text()='Enter']")
I tried to get a button based on his text ("Enter") with the aim to click on it but without success.
Element := Page.getElementsbyXpath("//*[text()='Enter']")
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Hope this would help, as even me was confused with innerText being considered as an innerHTML, sometime innerText are empty but innerHtml are the innerText,cristalgrip wrote: ↑19 Feb 2023, 15:56I can't figure out a way to get an element based on the text it has written. Any help?
I tried to get a button based on his text ("Enter") with the aim to click on it but without success.
Element := Page.getElementsbyXpath("//*[text()='Enter']")
Code: Select all
#include Rufaydium.ahk
chrome := new Rufaydium() ; to download and launch chrome driver
Page := Chrome.NewSession() ; to create session
Page.Url := "https://www.autohotkey.com/boards/index.php" ; to navigate
Elements := Page.getElementsbyXpath("//*[contains(text(),'Search')]") ; return with elements object that contain 'Search' text
for k, Element in Elements ; here looping through elements
msgbox, % "TagName: " Element.TagName "`nValue: " Element.Value "`ninnerText: " Element.innerText "`n`ninnerHTML : " Element.innerHTML "`n`nouterHTML : " Element.outerHTML
msgbox, press f12 to quit session and exit driver
return
f12::
Page.quit() ; to quit session
Chome.Exit() ; to exit driver
msgbox, script gonna exit...!
exitapp
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Thank you very much!
I have another question...
I don't understand why this doesn't work and give an empty message box
while this works, giving the class of the object.
I have another question...
I don't understand why this doesn't work and give an empty message box
Code: Select all
this_is_a_function()
{
Page.Frame(2)
stringa:="//div[@id=""game-board""]/div[3]/div[1]"
classe_el:=Page.getElementsbyXpath(stringa)[0].Class
MsgBox, %classe_el%
}
Code: Select all
2::
Page.Frame(2)
stringa:="//div[@id=""game-board""]/div[3]/div[1]"
classe_el:=Page.getElementsbyXpath(stringa)[0].Class
MsgBox, %classe_el%
return
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
You should learn about functions, read about Global, Local and Static variables and learn how to pass variable to a function.cristalgrip wrote: ↑21 Feb 2023, 15:14I don't understand why this doesn't work and give an empty message boxCode: Select all
this_is_a_function() { Page.Frame(2) stringa:="//div[@id=""game-board""]/div[3]/div[1]" classe_el:=Page.getElementsbyXpath(stringa)[0].Class MsgBox, %classe_el% }
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
I'm sorry, maybe I explained myself poorly or I didn't understand the answer. The function has no variables to return and no variables to be passed.Xeo786 wrote: ↑22 Feb 2023, 00:14You should learn about functions, read about Global, Local and Static variables and learn how to pass variable to a function.cristalgrip wrote: ↑21 Feb 2023, 15:14I don't understand why this doesn't work and give an empty message boxCode: Select all
this_is_a_function() { Page.Frame(2) stringa:="//div[@id=""game-board""]/div[3]/div[1]" classe_el:=Page.getElementsbyXpath(stringa)[0].Class MsgBox, %classe_el% }
The function should just show a message box with the class of the element.
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
Ops, i think i get it. Ignore my previous messageXeo786 wrote: ↑22 Feb 2023, 00:14You should learn about functions, read about Global, Local and Static variables and learn how to pass variable to a function.cristalgrip wrote: ↑21 Feb 2023, 15:14I don't understand why this doesn't work and give an empty message boxCode: Select all
this_is_a_function() { Page.Frame(2) stringa:="//div[@id=""game-board""]/div[3]/div[1]" classe_el:=Page.getElementsbyXpath(stringa)[0].Class MsgBox, %classe_el% }
-
- Posts: 19
- Joined: 26 Aug 2022, 07:18
Chrome Headless
Headless mode no longer working after Chrome update to version 110.0.5481.178. Is this behavior expected or just my pc? I searched the internet and the only relevant topic is that selenium changed its headless mode argument.
PS: Are you planning to support AHK v2?
Thanks!
Update: Used the same method as selenium and now it works even better than before (i.e: can now save cookies in headless mode, didn't work before)
PS: Are you planning to support AHK v2?
Thanks!
Update: Used the same method as selenium and now it works even better than before (i.e: can now save cookies in headless mode, didn't work before)
browser.capabilities.addArg("--headless=new")
-
- Posts: 16
- Joined: 05 Mar 2023, 11:17
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
This is my first attempt at programming with AutoHotKey
English is not my main language
Because I use Google translation, please forgive me for the inappropriate expression
English is not my main language
Because I use Google translation, please forgive me for the inappropriate expression
-
- Posts: 36
- Joined: 19 Feb 2023, 15:52
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
There is a way for the webdriver to interact with a canvas element where JavaScript is used to draw, write, insert images ecc dynamically?
Re: Rufaydium WebDriver 1.7.2 (no selenium/websocket)
you can use JAVA script, look for Session.ExecuteSync()cristalgrip wrote: ↑09 Mar 2023, 09:07There is a way for the webdriver to interact with a canvas element where JavaScript is used to draw, write, insert images ecc dynamically?
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
Re: Chrome Headless
Yes Rufaydium V2 Alpha Branch
Thank you update...! just added this to capabilities, yah window handling has also been changed which I recently updated.yousef_badr23 wrote: ↑25 Feb 2023, 06:31Update: Used the same method as selenium and now it works even better than before (i.e: can now save cookies in headless mode, didn't work before)browser.capabilities.addArg("--headless=new")
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory
-
- Posts: 19
- Joined: 26 Aug 2022, 07:18
Re: Chrome Headless
[Mod edit: Fixed quote tags, how they were meant to be, I guess.]
Thanks for your great effort!!
I tried my hand at V2 and would like to detail some hiccups (and how I fixed them) while trying the demo you posted at the readme.
There were 2 hiccups, both related to directories
First:
When specifying the location of the chrome webdriver, it would fail to load, but would load correctly when it is in the same folder as my test script.
After digging through the callout stack, I changed line 52 at WDM.ahk to
Code: Select all
this.Target := this.Dir "\" this.exe " '" this.param "'"
Second:
When I would get an error (Error: (126) The specified module could not be found) from the json library when starting my test script. I had to change the native load module to
Code: Select all
Native.LoadModule(A_LineFile '\..\JSON\' (A_PtrSize * 8) 'bit\ahk-json.dll', ['JSON'])
Once I made these changes, I could finally try the beginning of your demo
I haven't tried much elseChrome := Rufaydium("Down\webdrivers\chromedriver.exe")
Page := Chrome.NewSession()
Page.url := "https://www.autohotkey.com/boards"
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 131 guests