satter Posted November 25, 2020 Share Posted November 25, 2020 #include <File.au3> #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupGecko() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://soap2day.im/") Func SetupGecko() _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' EndFunc I want view https://soap2day.im using webdriver but cloudflare has blocked. Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2020 Author Share Posted November 25, 2020 @satter Thanks for explaining. Unfortunately, I'm not currently aware of a way to bypass this issue. satter 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 25, 2020 Share Posted November 25, 2020 A quick search it might be possible in python to handle a problem like this using execute_cdp_cmd but I don't think there is a way to do this in autoit but I'm no expert: https://stackoverflow.com/questions/53039551/selenium-webdriver-modifying-navigator-webdriver-flag-to-prevent-selenium-detec Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2020 Author Share Posted November 25, 2020 @NassauSky See _WD_ExecuteCdpCommand in wd_helper.au3 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 26, 2020 Share Posted November 26, 2020 (edited) Question: Is there a trick to acquiring pre-click elements or pre-keypress elements. For example if I connect to my webserver which changes html data frequently and I manually type in a value to search for and press enter, it seems $LastFieldVal = _WD_ElementAction($sSession, $LastClickMelem, 'attribute', 'value') is gone instantly after pressing Enter. The value in the field is not accurate after the Enter key is pressed or a submit button is clicked. Edited November 27, 2020 by NassauSky Link to comment Share on other sites More sharing options...
Danp2 Posted November 27, 2020 Author Share Posted November 27, 2020 @NassauSky Not sure that I follow your description of the situation. Are you receiving an error, such as "stale element reference"? Or is the issue that you are unable to retrieve the value that you just entered once the form is submitted? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 27, 2020 Share Posted November 27, 2020 I apologize it’s the latter Link to comment Share on other sites More sharing options...
Danp2 Posted November 27, 2020 Author Share Posted November 27, 2020 @NassauSky What's your "use case"? In other words, why do you need access to this information? Be specific. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 27, 2020 Share Posted November 27, 2020 (edited) @Danp2 Hmmm come to think of it I might not need to do it that way. Generally it's just me running the tests so I can do it myself. Trying to make my life easier collecting a vast amount of statistics and while I was working on the project I was thinking to make it future usable for a broader spectrum of options. Thanks for being quick with your responses. It was a holiday. Edited November 27, 2020 by NassauSky Link to comment Share on other sites More sharing options...
samibb Posted November 30, 2020 Share Posted November 30, 2020 DEAR @Danp2 i have opened Telnet and i Attached with exist web page . my case is i could not put a value to text and click the button . i have use many ways but not working expandcollapse popupSetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) MsgBox(0,'$sSession',$sSession) ;_WD_Navigate($sSession, "https://vpn.saudia.com:11029/1ASIHGAPSV/arp/index.html?SITK=QQC5RKM89J000203FNCAYXNE0002&SITK2=QQC5RKM89J000203FNCAYXNE0002&SYS=PRODUCTION&PHS=PRD") _WD_Attach ($sSession,"Amadeus Retailing Platform - PRD(PRODUCTION)",DefaulT) SendElements("//input[@name=aFSearchParameter]",'056') ;SendElements("//input[ name='aFSearchParameter']",'056') ;SendElements("//input[@ID='txtPassword']",'sami') MsgBox(0,0,'stop') ;;DemoClick("//button[@ID='btnSearchId']") ;;MsgBox(0,1,'stop') Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}}' EndFunc Func SendElements($Elment,$TXT) Local $sElement, $aElements, $sValue, $sButton, $sResponse, $bDecode, $sDecode, $hFileOpen ;*********************************************************************** $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $Elment) MsgBox(0,$TXT,$sElement) ;*********************************************************************** Local $TKT_ID = _WD_GetElementByName($sSession, 'aFSearchParameter') MsgBox(0,'$TKT_ID',$TKT_ID) ;*********************************************************************** $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iput", Default) _ArrayDisplay($aElements, "Found Elements") ;*********************************************************************** for $i = 0 to UBound($aElements)-1 $sValue = _WD_ElementAction($sSession, StringStripWS($aElements[$i],8),'NAME') MsgBox(0,'Name',$sValue) Next ;*********************************************************************** $sValue = _WD_ElementAction($sSession, $sElement, 'property', 'value') _WD_ElementAction($sSession, $sElement, 'clear') ; Set element's contents ;MsgBox(0,'Send user',$TXT) _WD_ElementAction($sSession, $sElement, 'value', $TXT) ;MsgBox(0,'send done',$sElement) ; Retrieve then clear contents EndFunc Link to comment Share on other sites More sharing options...
Danp2 Posted November 30, 2020 Author Share Posted November 30, 2020 @samibb Telling me that something doesn't work without any further details isn't very helpful. 😒 Run this code in Scite and then post the resulting output -- #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Attach($sSession,"Amadeus Retailing Platform - PRD(PRODUCTION)",DefaulT) $sElement = _WD_GetElementByName($sSession, 'aFSearchParameter') If Not @error Then _WD_SetElementValue($sSession, $sElement, '056') EndIf Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}}' EndFunc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted December 1, 2020 Share Posted December 1, 2020 @Danp2 good day expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\11003813\Desktop\AutoIT\xxx111.au3" /UserParams +>07:31:24 Starting AutoIt3Wrapper v.16.612.1119.0 SciTE v.3.6.6.0 Keyboard:00000409 OS:WIN_81/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\11003813\Desktop\AutoIT\xxx111.au3 +>07:31:24 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\11003813\Desktop\AutoIT\xxx111.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WDStartup: OS: WIN_81 WIN32_NT 9600 _WDStartup: AutoIt: 3.3.14.2 _WDStartup: WD.au3: 0.3.1.0 (Up to date) _WDStartup: WinHTTP: 1.6.4.2 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --verbose --log-path="C:\Users\11003813\Desktop\AutoIT\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"86.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"86.0.4240.198","chrome":{"chromedriverVersion":"86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378})"},"goog:chromeOptions":{"debuggerAddress":"localhost:9222"},"pageLoadStrategy":"normal","platformName":"","proxy":{},"setWindowRect":false,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:virtualAuthenticators":true},"sessionId":"15283bdd9a40c0b5b227acb9a5e3b2ce"}} __WD_Get: URL=HTTP://127.0.0.1:9515/session/15283bdd9a40c0b5b227acb9a5e3b2ce/window/handles __WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":["CDwindow-35DB90B648DE5F59F606CC6BABB831FF","CDwindow-4797BE00D12B8E0B5702AC417283A770","C... _WD_Window: {"value":["CDwindow-35DB90B648DE5F59F606CC6BABB831FF","CDwindow-4797BE00D12B8E0B5702AC417283A770","C... __WD_Get: URL=HTTP://127.0.0.1:9515/session/15283bdd9a40c0b5b227acb9a5e3b2ce/window __WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"CDwindow-35DB90B648DE5F59F606CC6BABB831FF"}... _WD_Window: {"value":"CDwindow-35DB90B648DE5F59F606CC6BABB831FF"}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/15283bdd9a40c0b5b227acb9a5e3b2ce/window; $sData={"handle":"CDwindow-35DB90B648DE5F59F606CC6BABB831FF"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Window: {"value":null}... __WD_Get: URL=HTTP://127.0.0.1:9515/session/15283bdd9a40c0b5b227acb9a5e3b2ce/title __WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"Amadeus Retailing Platform - PRD(PRODUCTION)"}... _WD_Action: {"value":"Amadeus Retailing Platform - PRD(PRODUCTION)"} __WD_Post: URL=HTTP://127.0.0.1:9515/session/15283bdd9a40c0b5b227acb9a5e3b2ce/element; $sData={"using":"xpath","value":"//*[@name=\"aFSearchParameter\"]"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//*[@name=\"aFSearchParameter\"]\"}\n (Session info: chrome=86.0.4240.198)","stacktrace":"Backtrace:\n\tOrdinal0 [0x003EC013+3194899]\n\tOrdinal0 [0x002D6021+2056225]\n\tOrdinal0 [0x0016F608+587272]\n\tOrdinal0 [0x000FB5A1+112033]\n\tOrdinal0 [0x0011B182+242050]\n\tOrdinal0 [0x0010FDAA+196010]\n\tOrdinal0 [0x00119B22+236322]\n\tOrdinal0 [0x0010FC1B+195611]\n\tOrdinal0 [0x000F3B7F+80767]\n\tOrdinal0 [0x000F4B4E+84814]\n\tOrdinal0 [0x000F4AD9+84697]\n\tOrdinal0 [0x002ECE64+2149988]\n\tGetHandleVerifier [0x0055BE95+1400773]\n\tGetHandleVerifier [0x0055BB61+1399953]\n\tGetHandleVerifier [0x005631FA+1430314]\n\tGetHandleVerifier [0x0055C69F+1402831]\n\tOrdinal0 [0x002E3D61+2112865]\n\tOrdinal0 [0x002EE5CB+2155979]\n\tOrdinal0 [0x002EE6F5+2156277]\n\tOrdinal0 [0x002FF26E+2224750]\n\tBaseThreadInitThunk [0x775F495D+14]\n\tRtlInitializeExceptionChain [0x779B98EE+132]\n\tRtlInitializeExceptionChain [0x779B98C4+90]\n\t(No symbol) [0x00000000]\n"}} _WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//*[@name=\"aFSearchParameter\"]\"}\n (Session info: chrome=86.0.4240.198)","stacktrace":"Backtrace:\n\tOrdinal0 [0x003EC013+3194899]\n\tOrdinal0 [0x002D6021+2056225]\n\tOrdinal0 [0x0016F608+587272]\n\tOrdinal0 [0x000FB5A1+112033]\n\tOrdinal0 [0x0011B182+242050]\n\tOrdinal0 [0x0010FDAA+196010]\n\tOrdinal0 [0x00119B22+236322]\n\tOrdinal0 [0x0010FC1B+195611]\n\tOrdinal0 [0x000F3B7F+80767]\n\tOrdinal0 [0x000F4B4E+84814]\n\tOrdinal0 [0x000F4AD9+84697]\n\tOrdinal0 [0x002ECE64+2149988]\n\tGetHandleVerifier [0x0055BE95+1400773]\n\tGetHandleVerifier [0x0055BB61+1399953]\n\tGetHandleVerifier [0x005631FA+1430314]\n\tGetHandleVerifier [0x0055C69F+1402831]\n\tOrdinal0 [0x002E3D61+2112865]\n\tOrdinal0 [0x002EE5CB+2155979]\n\tOrdinal0 [0x002EE6F5+2156277]\n\tOrdinal0 [0x002FF26E+2224750]\n\tBaseThreadInitThunk [0x775F495D+14]\n\tRtlInitializeExceptionChain [0x779B98EE+132]\n\tRtlInitializeExceptionChain [0x779B98C4+90]\n\t(No symbol) [0x00000000]\n"}} _WD_FindElement ==> No match: HTTP status = 404 _WD_GetElementByName ==> No match +>07:31:30 AutoIt3.exe ended.rc:0 +>07:31:30 AutoIt3Wrapper Finished. >Exit code: 0 Time: 6.247 Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted December 1, 2020 Author Share Posted December 1, 2020 @samibb So the element isn't being found. What steps have you taken to figure out why? Have you ruled out frames? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted December 1, 2020 Share Posted December 1, 2020 (edited) @Danp2 when i use "//div" ,i get 35 elements . only labels, no text or button . see as you see in the image down Have you ruled out frames? No, how please? $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div", Default, True) _ArrayDisplay($aElements, "Found Elements") ;msgBox(0,'clear',$sElement) for $i = 0 to UBound($aElements) - 1 ;$sElement = "txtUsername" $sValue = _WD_ElementAction($sSession, $aElements[$i], 'text') MsgBox(0,$aElements[$i],$sValue) Next Edited December 1, 2020 by samibb Link to comment Share on other sites More sharing options...
Danp2 Posted December 1, 2020 Author Share Posted December 1, 2020 @samibb This thread was intended to be the "development" thread for the Webdriver UDF. Please either start a new thread or move to the "support" thread, which can be found here. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted December 23, 2020 Share Posted December 23, 2020 I have a problem with the RAM. When the program runs Chrome, Chrome will gradually use the entire RAM until it stops and gives me this message : “Aw, Snap. Something went wrong while displaying this webpage” Error :Out of memory How is it possible to free up memory and make Chrome to continue running ? Link to comment Share on other sites More sharing options...
Danp2 Posted December 23, 2020 Author Share Posted December 23, 2020 @samibb Please read the post directly above your latest one and follow those instructions. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DreamMaker Posted December 26, 2020 Share Posted December 26, 2020 有没有类似于 _IEBodyReadText()? Link to comment Share on other sites More sharing options...
Nine Posted December 26, 2020 Share Posted December 26, 2020 20 minutes ago, DreamMaker said: _IEBodyReadText()? First post and you made me laugh. Thanks for that. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted December 27, 2020 Author Share Posted December 27, 2020 1 hour ago, DreamMaker said: Is it similar to _IEBodyReadText()? Untested, but you should be able to do something like this -- _WD_ExecuteScript($sSession, "return document.body.innerText;", '{}') P.S. Next time, please use Google Translate and post your message in English instead of Chinese. 🙂 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now