Jump to content

Recommended Posts

Posted

I have used  webdriverUDF with Edge browser to access a website in AutoIt. The issue is When I open the website in the Edge browser there is no captcha. But when I open it in the AutoIT Webdriver UDF (using Edge), The captcha appeared.  can anyone help me on this?

 

Posted

@Danp2 thank you for your reply, please see my coding 

#include <wd_helper.au3>
#include <wd_capabilities.au3>
#include <CSV.au3>
#include <Array.au3>
#include <_HtmlTable2Array.au3>
#include <Date.au3>
#include <DTC.au3>
Global $Desired_Capabilities = Null, $Session = Null, $District_Code = StringLeft(@UserName, 3), $PID = Null


Initiate_Browser()

_WD_Navigate($Session, "https://www.hapag-lloyd.com/en/online-business/tracing/tracing-by-container.html?container")
_WD_LoadWait($Session, Default, 10 * 1000)


Func Initiate_Browser()

    SetupEdge()
    $PID = _WD_Startup()
    $_WD_DEBUG = $_WD_DEBUG_None ;DISABLE FOR DEBUGGING

    For $Temp = 1 To 10
        Global $Session = _WD_CreateSession($Desired_Capabilities)
        If $Session <> '' Then
            ExitLoop
        Else
            If $Temp = 10 Then
                MsgBox(0,"Error","Session fail")
            Else
                Sleep(500)
            EndIf
        EndIf
    Next

    _WD_ConsoleVisible(False)
    _WD_Window($Session, 'Maximize')
EndFunc   ;==>Initiate_Browser

Func SetupEdge()
    _WD_Option('driver', "C:\Script_Resources\msedgedriver.exe")
    _WD_Option('port', 9515)
    _WD_Option('driverclose', True)
    _WD_Option('driverparams', '--verbose --log-path="' & @LocalAppDataDir & '\msedge.log"')
    $Desired_Capabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & _
            StringReplace(@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"],"args": ["-guest"],"useAutomationExtension": false}}}}'
EndFunc   ;==>SetupEdge

Func End_Browser()
    _WD_DeleteSession($Session)
    _WD_Shutdown($PID)
EndFunc   ;=
 

 

  • Developers
Posted
2 hours ago, RohanM said:

The captcha appeared.  can anyone help me on this?

Don't think so as that Captcha there for a reason and there is a pretty clear statement about this in our forum rules!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Jos locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...