Jump to content

WebDriver UDF - Help & Support (II)

Recommended Posts

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

As the WebDriver UDF - Help & Support thread has grown too big, I started a new one. The original thread can be found here.

@Danyfirex has identified that the issue originates in the BinaryCall UDF, which gets called by the JSON UDF. It registers an OnAutoITExitRegister function, that is freeing resources before the main O

Please use this Support thread for your questions. Thanks

Posted Images

I would like to know if it is possible to access these network resources after loading the page in firefox as shown in the image with webdriver I tried sending javascript command, sending header requests but with my little experience I could not get this data as the image, but I want it retrieve the data as an example in the image, this request list, but I don't know how to get it. I thank you for this work I like this udf very much.


Link to post
Share on other sites
8 hours ago, Danp2 said:

Olá @jbnet ,

Não sei ao certo o que você está tentando realizar. Você pode explicar seu "caso de uso"? Além disso, pode ajudar se você nos mostrou o que tentou até agora.


I am wanting to get all xhr data from the header. I want to get all URL lists, but the javascript code that I tested gets only the answers but I can't get the list of URLs. For example, upon entering the site, several requests are generated. I want to capture the urls of the generated requests, all the list, as I showed marked in the image, but I don't know how to get the whole list. The javascript example I sent doesn't have all the information, like the URLs. In the header, I want to get requests not only the answers, ie all the information cited in the browser.


$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://google.com")

$testeJavaScript = _WD_ExecuteScript($sSession,"function getHeadersAjax(url) { "& _
  " var r = new XMLHttpRequest();"& _
   "r.open('HEAD', url, false);"& _
   "r.send(null);"& _
   "return {"& _
   "   status: r.status, "& _
   "   statusText: r.statusText, "& _
   "   referrer: document.referrer,"& _
   "   rawheaders: r.getAllResponseHeaders(),"& _
    "};"& _
"} return getHeadersAjax(document.location.href); ")
MsgBox(0, "Infor", $testeJavaScript)


Another situation is how to get information from the firefox console, retrieve this information for autoit, is it possible?


Edited by jbnet
Link to post
Share on other sites
1 hour ago, Danp2 said:

Por quê? Como você usaria essas informações se pudesse capturá-las?

PS Não tenho certeza se isso é possível sem usar um proxy

I use webdriver to capture videos, searching for urls, I found a site where the url information to download the m3u8 file is in the header with this list I use fmpeg to download, inspecting the page the way I showed you in the image II find this url, that's why I would like to capture it. but if it is not possible, if I had to manipulate Firefox Extensions as downloadhelper capturing videos would also solve.

Link to post
Share on other sites

Hi @Danp2, I have a new problem :))
My computer is connected to 2 network cards, I will call network 1 and network 2.
I want the network option to use corresponding to DesCap, For example: Session 1 - DesiredCapabilities 1 - Network 1 and Session 2 - DesiredCapabilities 2 - Network 2.
Can I do this with Argument?
If not, how can I do this? Give me some keywords on this issue?

Edited by nguyenthaiytcc
Link to post
Share on other sites

Hi @RandalBY

No, I haven't thus far created a help file for this UDF. There are a set of examples that have been gathered together in wd_demo.au3, which is currently the best way to understand the operation of various functions.

P.S. This is an opensource project, so anyone is free to write the docs if they get the urge. 😄

Link to post
Share on other sites
1 hour ago, nguyenthaiytcc said:

Dear @Danp2, I am trying to access multiple accounts at the same time with multiple login sessions with multiple ip addresses as well as UAs. However, there are some websites that can detect MAC address, I thought I should use virtual network card to fake different MAC address. Is this possible? :)

websites can't detect your MAC. But if you want, you can use routing settings in windows (google for "route windows")

Link to post
Share on other sites

Hello All,

I have just discovered this UDF and tried to use it with Firefox with geckodriver.

_WD_Startup and _WD_CreateSession functions work fine to start the driver and open a browser window, but all the other commands return in error with "StatusCode=405; ResponseText=HTTP method not allowed"

Can anybody advice me ?

I also get a "_WD_CreateSession ==> Webdriver Exception" but I am not sure it is linked or not.

Link to post
Share on other sites

Welcome to AutoIt and the forum!

Could you please post the script you run and the full output of the console?

My UDFs and Tutorials:


Active Directory (NEW 2022-02-19 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version - Download
Outlook Tools (2019-07-22 - Version - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki
WebDriver - Wiki


Link to post
Share on other sites

Sure, here is the script

#include "common\wd_core.au3"
Local $sDesiredCapabilities
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "http://sit")
ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF)

Func SetupGecko()
_WD_Option('Driver', 'geckodriver.exe')
_WD_Option('DriverParams', '--log trace')
_WD_Option('Port', 4444)
$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'

And output :

_WDStartup: OS:    WIN_10 WIN32_NT 16299
_WDStartup: AutoIt:
_WDStartup: WD.au3:
_WDStartup: WinHTTP:
_WDStartup: Driver:    geckodriver.exe
_WDStartup: Params:    --log trace
_WDStartup: Port:    4444
__WD_Post: URL=HTTP://; $sData={"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}
__WD_Post: StatusCode=200; ResponseText={"value":{"sessionId":"c09c0114-40f0-4741-8474-1c5856efb076","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"71.0","javascriptEnabled":true,"moz:accessibilityChecks":false,"moz:buildID":"20191202093317","moz:geckodriverVersion":"0.26.0","moz:headless":false,"moz:processID":7884,"moz:profile":"C:\\Users\\pb19348\\AppData\\Local\\Temp\\rust_mozprofileM0GXnv","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"nativeEvents":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"10.0","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}
_WD_CreateSession: {"value":{"sessionId":"c09c0114-40f0-4741-8474-1c5856efb076","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"71.0","javascriptEnabled":true,"moz:accessibilityChecks":false,"moz:buildID":"20191202093317","moz:geckodriverVersion":"0.26.0","moz:headless":false,"moz:processID":7884,"moz:profile":"C:\\Users\\pb19348\\AppData\\Local\\Temp\\rust_mozprofileM0GXnv","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"nativeEvents":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"10.0","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}
_WD_CreateSession ==> Webdriver Exception
__WD_Post: URL=HTTP://; $sData={"url":"http://sit"}
__WD_Post: StatusCode=405; ResponseText=HTTP method not allowed
_WD_Navigate: HTTP method not allowed
__WD_Get: URL=HTTP://
__WD_Get: StatusCode=405; $iResult = 0; $sResponseText=HTTP method not allowed...
_WD_Action: HTTP method not allowed


Link to post
Share on other sites
  • Jos locked this topic
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...