Jump to content

Recommended Posts

Posted

Hello all,

I need help regarding "_IELinkClickByText"

The HTML Code is:

<span class="ng-binding" ng-bind="::transaction.arrival_time | userDate : ta.data.settings.profile_settings">20160518 01:20:30</span>

In my code i need to click the text (in bold), i keep getting $_IESTATUS_NoMatch.

What am i missing???

Many thanks.

Posted

Please post url to the website or post here a little wider HTML snippet.

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)

Sorry, i cannot post the url (it requires User Nmae and password)

Attach a text file and pic with some more detailes.

As u see i need to click the first link (20160518 01:20:30) i can get the link but when i am using _IEClickbytext it keeps telling me IE_Status_NOt_Match:'(

I relly aprriciate your help!

 

Element.txt

Capture.JPG

Edited by avidovi
update
Posted

Thanks @Danp2 i did not know that.

I have searched the forum for a solution but it didn't work.

Can u suggest me one?

Thank a lot..

Posted
Local $oClassReturn = $oIE.document.getElementsByClassName("ng-scope")
If Not IsObj($oClassReturn) Then Exit ConsoleWrite("Error in $oClassReturn" & @CRLF)

Local $oTagReturn = $oClassReturn.Item(0).getElementsByTagName("span")
If Not IsObj($oTagReturn) Then Exit ConsoleWrite("Error in $oTagReturn" & @CRLF)

$oTagReturn.Item(0).click()

Hi avidovi,

Without seeing your AutoIT code I can't tell if you're using $oIE as your IE Object handle but if so then try the above code, you may need to increase $oTagReturn.Item(0).click() up by 1 until it corresponds with the correct selection.

Hope this works for you.

Posted

As I stated before show little wider HTML snippet, for example inspect the entire row which was showed in screenshot from post #3.
Of course you can edit, and delete some sensitive data.

 

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

@mLipok and @Dent thanks for your help.

I tried Dents option - and i am getting no values at all.

@mLipok as u requested atached the whole row

again thank!!

<tr class="firstline twolines" ng-class="{openmessage: transaction.show_info, twolines: search.layout.rows == 2, oneline: search.layout.rows == 1}"><td><a ui-sref=".details.details({'transactionId':transaction.id})" ng-click="ta.setSelectedTransaction(transaction.id); $event.stopPropagation();" title="UTC+03:00" href="/app/transactions/EDIVAN1-PROD-GEISCO3P252U670001-20160525192046/details"><span ng-bind="::transaction.arrival_time | userDate : ta.data.settings.profile_settings" class="ng-binding">20160526 05:20:46</span></a> <!-- ngIf: search.layout.rows == 1 --> <!-- ngIf: search.layout.rows == 1 && transaction.fa_status --></td><!-- ngRepeat: title in search.layout.first_row --><td ng-repeat="title in search.layout.first_row" ng-show="title.FieldEntry != null" colspan="1" ng-class="{'last-field':$last}" set-field-value="" transaction="transaction" field="title" class="ng-scope ng-isolate-scope ng-hide"><!-- ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngRepeat: label in transaction.values['labels_orig'] track by $index --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><div ng-if="search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" class="ng-scope"><!-- ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --><span ng-if="!title.can_add_to_facet &amp;&amp; !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 &amp;&amp; transaction.values[title.FieldEntry.IndexFieldName].length == 20)" ng-bind="::transaction.values[title.FieldEntry.IndexFieldName] " class="ng-binding ng-scope"></span><!-- end ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --> <!-- ngIf: !title.can_add_to_facet && title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20 --></div><!-- end ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) !== -1 && title.FieldEntry.IndexFieldName != 'labels' --></td><!-- end ngRepeat: title in search.layout.first_row --><td ng-repeat="title in search.layout.first_row" ng-show="title.FieldEntry != null" colspan="1" ng-class="{'last-field':$last}" set-field-value="" transaction="transaction" field="title" class="ng-scope ng-isolate-scope" title="KOHLS"><!-- ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><a ng-if="title.can_add_to_facet &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" ng-click="ta.addFilterFromList(transaction, title);$event.stopPropagation();" class="ng-scope"><span ng-bind="::transaction.values[title.FieldEntry.IndexFieldName]" class="ng-binding">KOHLS</span></a><!-- end ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngRepeat: label in transaction.values['labels_orig'] track by $index --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><div ng-if="search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" class="ng-scope"><!-- ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --> <!-- ngIf: !title.can_add_to_facet && title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20 --></div><!-- end ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) !== -1 && title.FieldEntry.IndexFieldName != 'labels' --></td><!-- end ngRepeat: title in search.layout.first_row --><td ng-repeat="title in search.layout.first_row" ng-show="title.FieldEntry != null" colspan="1" ng-class="{'last-field':$last}" set-field-value="" transaction="transaction" field="title" class="ng-scope ng-isolate-scope" title="TAA APPAREL"><!-- ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><a ng-if="title.can_add_to_facet &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" ng-click="ta.addFilterFromList(transaction, title);$event.stopPropagation();" class="ng-scope"><span ng-bind="::transaction.values[title.FieldEntry.IndexFieldName]" class="ng-binding">TAA APPAREL</span></a><!-- end ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngRepeat: label in transaction.values['labels_orig'] track by $index --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><div ng-if="search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" class="ng-scope"><!-- ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --> <!-- ngIf: !title.can_add_to_facet && title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20 --></div><!-- end ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) !== -1 && title.FieldEntry.IndexFieldName != 'labels' --></td><!-- end ngRepeat: title in search.layout.first_row --><td ng-repeat="title in search.layout.first_row" ng-show="title.FieldEntry != null" colspan="1" ng-class="{'last-field':$last}" set-field-value="" transaction="transaction" field="title" class="ng-scope ng-isolate-scope" title="GEISCO3P252U670001-20160525192046"><!-- ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngRepeat: label in transaction.values['labels_orig'] track by $index --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><div ng-if="search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" class="ng-scope"><!-- ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --><span ng-if="!title.can_add_to_facet &amp;&amp; !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 &amp;&amp; transaction.values[title.FieldEntry.IndexFieldName].length == 20)" ng-bind="::transaction.values[title.FieldEntry.IndexFieldName] " class="ng-binding ng-scope">GEISCO3P252U670001-20160525192046</span><!-- end ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --> <!-- ngIf: !title.can_add_to_facet && title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20 --></div><!-- end ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) !== -1 && title.FieldEntry.IndexFieldName != 'labels' --></td><!-- end ngRepeat: title in search.layout.first_row --><td ng-repeat="title in search.layout.first_row" ng-show="title.FieldEntry != null" colspan="1" ng-class="{'last-field':$last}" set-field-value="" transaction="transaction" field="title" class="ng-scope ng-isolate-scope last-field" title="EDI"><!-- ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><a ng-if="title.can_add_to_facet &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" ng-click="ta.addFilterFromList(transaction, title);$event.stopPropagation();" class="ng-scope"><span ng-bind="::transaction.values[title.FieldEntry.IndexFieldName]" class="ng-binding">EDI</span></a><!-- end ngIf: title.can_add_to_facet && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngRepeat: label in transaction.values['labels_orig'] track by $index --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><div ng-if="search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 &amp;&amp; title.FieldEntry.IndexFieldName != 'labels'" class="ng-scope"><!-- ngIf: !title.can_add_to_facet && !(title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20) --> <!-- ngIf: !title.can_add_to_facet && title.FieldEntry.IndexFieldName.indexOf('date') > -1 && transaction.values[title.FieldEntry.IndexFieldName].length == 20 --></div><!-- end ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) === -1 && title.FieldEntry.IndexFieldName != 'labels' --><!-- ngIf: search.linkFields.indexOf(title.FieldEntry.IndexFieldName) !== -1 && title.FieldEntry.IndexFieldName != 'labels' --></td><!-- end ngRepeat: title in search.layout.first_row --><td class="quickactions-field" rowspan="2"><!-- ngIf: !transaction.selected --><div ng-if="!transaction.selected" ng-click="ta.openQuickActions(transaction.id, $event)" class="toggle-item-actions ng-scope" data-toggle="dropdown" role="button"><div class="qact-btn"></div></div><!-- end ngIf: !transaction.selected --><!-- ngIf: transaction.selected --></td><td rowspan="2" class="toggle maintoggle pointer" ng-click="search.toggleMoreInfo(transaction);$event.stopPropagation();" ng-class="{active: transaction.show_info}"></td></tr>

 

Posted

Its very hard to help when we can not see the URL (i know that it requires username and password) and the code that you are using to try to click. You could be dealing with frames here, have you check that possibilitie?

From what i can see the span element its inside the "a" element so as the func "_IELinkClickByText" use "outerText" it should grab it. From the html that you have provided i have tested and its working. See if you are dealing with frames and test this:

#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Local $oFrames = _IEFrameGetCollection($oIE)
If @error Then
    Exit ConsoleWrite("Error in $oFrames" & @CRLF)
Else
    Local $iNumFrames = @extended
EndIf

MsgBox(0, "", "Nº Frames: " & $iNumFrames)

Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    If Not IsObj($oFrame) Or @error Then Exit ConsoleWrite("Error in $oFrame | @error: " & @error & @CRLF)
    
    _IELinkClickByText($oFrame, "20160526 05:20:46", 0, 0) ;*********** make sure the text is equal in the website
    If @error Then
        MsgBox(0, "", "@error: " & @error)
    Else
        Exit MsgBox(0, "Link Found", "Check if the link was clicked")
    EndIf
Next

MsgBox(0, "", "Link Not Found")

Exit

Please pay attention to the commented lines.

Posted

Lets try another code:

#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
If Not IsObj($oLinks) Or @error Then Exit ConsoleWrite("Error in $oLinks | @error: " & @error & @CRLF)

ConsoleWrite("Nº of Links: " & $iNumLinks & @CRLF & @CRLF)

For $oLink In $oLinks
    ConsoleWrite("TEXT: " & $oLink.outerText & @CRLF)
    ConsoleWrite("HREF: " & $oLink.href & @CRLF & @CRLF)
Next

ConsoleWrite(@CRLF & "######################################################" & @CRLF & @CRLF& @CRLF)

Local $sHTML = _IEDocReadHTML($oIE)
If @error Then Exit ConsoleWrite("Error in $sHTML")

Local $aLinks = StringRegExp($sHTML, '(?is)<a (.*?)</a>', 3)
If @error Then Exit ConsoleWrite("Error in $aLinks | @error: " & @error & @CRLF)

ConsoleWrite("Nº of Links: " & UBound($aLinks) & @CRLF & @CRLF)

For $i = 0 To UBound($aLinks)-1
    $aResultText  = StringRegExp($aLinks[$i], '>([^<]+)', 3)
    If @error Then Exit ConsoleWrite("Error in $aResultText | $i: " & $i & " | @error: " & @error & @CRLF)
    ConsoleWrite("TEXT: ")
    For $j = 0 To UBound($aResultText)-1
        If Not StringRegExp($aResultText[0], "[A-Za-z0-9]") Then ContinueLoop
        If $j > 0 Then ConsoleWrite(" ")
        ConsoleWrite($aResultText[$j])
    Next
    ConsoleWrite(@CRLF & "HREF: ")

    $aResultHref  = StringRegExp($aLinks[$i], 'href="([^"]+)', 3)
    If @error Then
        ConsoleWrite("0")
        ConsoleWrite(@CRLF & @CRLF)
        ContinueLoop
    EndIf
    For $j = 0 To UBound($aResultHref)-1
        If $j > 0 Then ConsoleWrite(" ")
        ConsoleWrite($aResultHref[$j])
    Next
    ConsoleWrite(@CRLF & @CRLF)
Next

ConsoleWrite(@CRLF & "####### OK #######" & @CRLF)

Exit

I need all the console output.

Posted

Try both codes and let me know the output. Make sure that the current website has the link 20160518 01:20:30 (use Ctrl+f in the website, just to make sure).

#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
If Not IsObj($oLinks) Or @error Then Exit ConsoleWrite("Error in $oLinks | @error: " & @error & @CRLF)

ConsoleWrite("Nº of Links: " & $iNumLinks & @CRLF & @CRLF)

Local $sLinkOuterText, $sLinkHref
For $oLink In $oLinks
    $sLinkOuterText = $oLink.outerText
    $sLinkHref = $oLink.href
    ConsoleWrite("TEXT: " & $sLinkOuterText & @CRLF)
    ConsoleWrite("HREF: " & $sLinkHref & @CRLF)
    If $sLinkOuterText = "20160518 01:20:30" Then
        _IEAction($oLink, "click")
        ConsoleWrite("Link found and clicked." & @CRLF)
        Exit
    EndIf
    ConsoleWrite(@CRLF)
Next

Exit
#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

_IELinkClickByText($oIE, "20160518 01:20:30")
If @error Then ConsoleWrite("Error n:" & @error & @CRLF)

Exit

 

Posted (edited)
22 hours ago, MichaelHB said:

Try both codes and let me know the output. Make sure that the current website has the link 20160518 01:20:30 (use Ctrl+f in the website, just to make sure).

#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
If Not IsObj($oLinks) Or @error Then Exit ConsoleWrite("Error in $oLinks | @error: " & @error & @CRLF)

ConsoleWrite("Nº of Links: " & $iNumLinks & @CRLF & @CRLF)

Local $sLinkOuterText, $sLinkHref
For $oLink In $oLinks
    $sLinkOuterText = $oLink.outerText
    $sLinkHref = $oLink.href
    ConsoleWrite("TEXT: " & $sLinkOuterText & @CRLF)
    ConsoleWrite("HREF: " & $sLinkHref & @CRLF)
    If $sLinkOuterText = "20160518 01:20:30" Then
        _IEAction($oLink, "click")
        ConsoleWrite("Link found and clicked." & @CRLF)
        Exit
    EndIf
    ConsoleWrite(@CRLF)
Next

Exit
#include <IE.au3>

Local $oIE = ;******* i dont know if you are using IECreate or IEAttach, just put it here
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

_IELinkClickByText($oIE, "20160518 01:20:30")
If @error Then ConsoleWrite("Error n:" & @error & @CRLF)

Exit

 

First thank u!!!

i did not really understand how the link was clicked??  i  did the same thing with _IELinkClickByText but in my script it did not worked.

Can u explain to me please.

attached the first code output.

First code.txt

Edited by avidovi
Posted
52 minutes ago, avidovi said:

first thank u

You are welcome. :)

52 minutes ago, avidovi said:

second can u explain to me please.

You missed something but i cant know what without seeing all the code that you were using. Both codes worked for you?

Posted

The first code basically does the same as the second, was just to make sure that you have not changed the IE UDF code. As i stated before i cant know what was the issue without seeing the code that you were using.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...