Jump to content

Recommended Posts

Posted

Hi Guys,

First of all thank you both for your quick replies, I can actually say that we already have a winner !

  On 6/21/2023 at 6:38 PM, mLipok said:
Expand  

Unfortunately this did not work, luckily I was close to default settings so no harm done 😅

  On 6/21/2023 at 5:45 PM, Danp2 said:

Check your environmental settings that control the location of temporary files (%temp% and %tmp%), and update them to reflect a location that doesn't require Admin privileges.

Edit: Suggest that you review this prior thread.

Expand  

Well next time, just stick to your guns. Moving the include folder, by amending the register to reflect a folder in "my documents" has it running no problem at all!

Just one last question, will this change be reflected in an error if I try to run the script on another machine? I don't expect it will, however prefer to be thorough before proceeding. 

Thank you both so much!

Posted

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@mLipok i realy do not think that google is crawling the web in a headless browser, if he is then he would not need site map to help him navigate.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

  Reveal hidden contents


460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Posted

Hello Everyone!

Been a bit since I've posted on here but I have come across an issue that I could just be overlooking and cannot get past. I work for a local government agency so I cannot share too much information, which I know isn't ideal and can probably make it so I can't be helped, but I will try to share as much as I can.

I keep getting an error when trying to enter an iFrame that was working for months. This morning the website I am automating updated it's URL, so I am going step by step making sure all the xPath's and elements haven't changed as well. Turns out 99% of it is still the same.

When I get to my step of entering an iFrame using FrameEnter, it throws an error every time, even though the iFrame xpath didn't change at all in the html.

This is the iFrame element:

<iframe allow="geolocation *; microphone *; camera *" frameborder="0" height="500px" id="j_id9" name="j_id9" src="https://dmahs-nj.my.site.com/admintool/AVS_REPORT?RequestID=1098578" title="Content" width="1200px"></iframe>

This is the iFrame's Xpath:

//*[@id="j_id9"]

This is the snippet of the code:

;Locate iFRAME and enter it
    _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='j_id9']",0,10000)
    If @error Then
        MsgBox(0, "iFrame Error", "WaitElement for iFrame Error")
        Exit
    EndIf
    Sleep(2000) ;2 second sleep is only here for testing
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='j_id9']")
    If @error Then
        MsgBox(0, "iFrame Error", "FindElement iFrame Error"&@CRLF&@error)
        Exit
    EndIf
    Sleep(2000) ;2 second sleep is only here for testing
    _WD_FrameEnter($sSession,$sElement)
    If @error Then
        MsgBox(0, "iFrame Error", "FrameEnter iFrame Error"&@CRLF&@error&@CRLF&$sElement)
        Exit
    EndIf

This is console output:

_WD_WaitElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//*[@id='j_id9']   Delay=0   Timeout=10000   Options=Default
__WD_Post ==> Success [0] : HTTP status = 200
_WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//*[@id='j_id9']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default
_WD_FrameEnter ==> Invalid argument [5] : Parameters:    Identifier=C2121657FAA2FC7757E94F6A9B188BB8_element_113
+>09:05:39 AutoIt3.exe ended.rc:0
+>09:05:39 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 55.9

What I've never had happen before is WaitElement see's it, FindElement get's it but for some reason FrameEnter is the only one having issues with it. Has anyone else run into this?

Thanks in advance and I know it may not get far with limited information.

Posted (edited)

Did you notice new awesome function related to frames ?

Check the udf and demo again.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
Hi all,
This is from my web

<table id="ctl00_BodyContent_ASPxCallbackPanel1_radConsent" border="0" style="font-family:Verdana;font-size:Smaller;height:16px;width:100px;">
            <tbody><tr>
                <td xpath="1"><input id="ctl00_BodyContent_ASPxCallbackPanel1_radConsent_0" type="radio" name="ctl00$BodyContent$ASPxCallbackPanel1$radConsent" value="Y" tabindex="48"><label for="ctl00_BodyContent_ASPxCallbackPanel1_radConsent_0">Yes</label></td><td><input id="ctl00_BodyContent_ASPxCallbackPanel1_radConsent_1" type="radio" name="ctl00$BodyContent$ASPxCallbackPanel1$radConsent" value="N" tabindex="48"><label for="ctl00_BodyContent_ASPxCallbackPanel1_radConsent_1">No</label></td>
            </tr>
        </tbody></table>


The below is my code 

    Local $PConsent = _WD_FindElement($oChrome, $_WD_LOCATOR_ByXPath,"//input[@id='ctl00_BodyContent_ASPxCallbackPanel1_radConsent_0']")
    _WD_ElementAction($oChrome, $PConsent, 'click')

and here is the error: 

_WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='ctl00_BodyContent_ASPxCallbackPanel1_radConsent_0']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default
__WD_Post ==> Element interaction issue [14] : HTTP status = 400
_WD_ElementAction ==> Element interaction issue [14] : Parameters:   Command=click   Option=Default

I am not sure why I cannot be able to click this Radio button no matter how I tried it. I even used this :

    $sButton=$PConsent
    ;Triple Click command
    $sAction  = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"'
    $sAction &= $sButton & '","' & $_WD_ELEMENT_ID & '":"' & $sButton & '"}},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}]}]}'

    ;Use _WD_Action to send the triple click command
    _WD_Action($oChrome, "actions", $sAction)
    
    but still no luck. 
    
    Do you have any suggestion to solve this issue?

 

Posted

When I run the following script on just one item (file attached) in the array:

For $i = 1 To 1 ;UBound($urlsArray) - 1

it works fine but when I try to run it for the whole array:

For $i = 1 To UBound($urlsArray) - 1

it dosen't work seems to do with _WD_Navigate not getting the next session.  What I'm I doing wrong .

Thanks for any help.

Joe

 

SetupGecko()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)

$urlsArray = FileReadToArray($processing & 'ecjurls.txt')
For $i = 1 To UBound($urlsArray) - 1
    $urlsArray[$i] = StringReplace($urlsArray[$i], '"', '%22')
    $urlsArray[$i] = StringRegExpReplace($urlsArray[$i], '^.*?#\{(.*?)$', 'http://hudoc.echr.coe.int/#{%22tabview%22:[%22document%22],$1')
    ConsoleWrite($urlsArray[$i] & @CRLF)
    _WD_Navigate($sSession, $urlsArray[$i])
    _WD_LoadWait($sSession, 5000, 15000)
    _WD_GetElementById($sSession, "results-list")
    $sHTML2 = _WD_GetSource($sSession)
    $file1 = FileOpen($out & $i & ".html", 258)
    If $file1 = -1 Then
        MsgBox(0, "Error", "Unable to open file:    " & $out & "ECHR_" & $i & ".html")
        Exit
    EndIf
    FileWrite($file1, $sHTML2)
    FileClose($file1)
Next
_WD_DeleteSession($sSession)
_WD_Shutdown()

ecjurls.txtFetching info...

Posted
  On 7/2/2023 at 1:53 PM, Jury said:
For $i = 1 To UBound($urlsArray) - 1
Expand  

Why you start from 1 instead 0 ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/2/2023 at 1:53 PM, Jury said:
$urlsArray = FileReadToArray($processing & 'ecjurls.txt')
Expand  

check @error 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/2/2023 at 2:55 PM, mLipok said:

check @error 

Expand  

It all works ok but it downloads just the first item three times (or two if I start with 1.   Sorry &processing is my directory I use for such things and ecjurls.txt is located there.

Posted

@Jury The target URLs are all viewed as identical, so not further navigation takes place following the initial one. You can confirm this yourself by manually testing with your browser. To fix this, you can modify the URL so that the browser thinks it's unique. For example, add this line before the navigation occurs --

$urlsArray[$i] = StringReplace($urlsArray[$i], '/#', '/?dummy=' & $i & '#')

P.S. This line isn't doing anything in your script since you don't check the result --

_WD_GetElementById($sSession, "results-list")

 

Posted (edited)

I notice that in some cases when Browser (in my case GoogleChrome) is loading

image.png.3db12cf62b2900200b45d4083bee8bd3.png

 

very often my app going to hung mode and is not able to interact with user.

Of course I use _WD_Sleep() so It should be interactable, but maybe something in winhttp.au3 or even deeply in "driver.exe" (chromedriver.exe)  or is it related to browser ?

Any opinion in this regards ?

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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

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