Thanks for your information
![🙏](http://cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f64f.png)
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)
Code: Select all
Chrome := new Rufaydium()
Session := Chrome.NewSession()
url := "https://nowsecure.nl"
Session.Navigate(url)
Session.Maximize()
sleep, 200
return
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/
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.
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")
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.
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
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
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% }
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% }
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% }
browser.capabilities.addArg("--headless=new")
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?
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")
[Mod edit: Fixed quote tags, how they were meant to be, I guess.]
Code: Select all
this.Target := this.Dir "\" this.exe " '" this.param "'"
Code: Select all
Native.LoadModule(A_LineFile '\..\JSON\' (A_PtrSize * 8) 'bit\ahk-json.dll', ['JSON'])
I haven't tried much elseChrome := Rufaydium("Down\webdrivers\chromedriver.exe")
Page := Chrome.NewSession()
Page.url := "https://www.autohotkey.com/boards"