titi9030

Click in hyperlink into website

6 posts in this topic

#1 ·  Posted

Hi, I need to click the following hyperlink in a webstie, I already get into, but IEFormSubmit did not work, which one can I use to work with this kind of button and click it 

 

<a id="dgd2345589_ctl02_Hyperlink2" href="./CHVP/ComplaintProcess.aspx?module=2&amp;Option=Registration">EUFAPROCESS</a>

Share this post


Link to post
Share on other sites



#2 ·  Posted

Have a look at the function: _IEGetObjById and _IEAction

For example:

#include <IE.au3>

Local $oIE = _IE_Example("http://www.yoururlhere.com")
Local $oLink = _IEGetObjById($oIE, "dgd2345589_ctl02_Hyperlink2")
_IEAction($oLink, "click")

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

#include <IE.au3>


Local $oIE = _IECreate("https://gccass.drs.com/")
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
Local $oLink = _IEGetObjById($oIE,"dgd2345589_ctl02_Hyperlink2")
_IEAction($oLink, "click")

it shows me a message:

 

IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (dgd22345589_ctl02_Hyperlink2)
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType

Share this post


Link to post
Share on other sites

#4 ·  Posted

Can you try this then:

#include <IE.au3>

Local $oIE = _IECreate("https://gccass.drs.com/")
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
Local $oLinks = _IELinkGetCollection($oIE)
For $oLink in $oLinks
    ConsoleWrite($oLink.id & @CRLF)
    If $oLink.id = "dgd2345589_ctl02_Hyperlink2" Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next

If you run it in Scite it should show you all the id of each link until it finds your link.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

HI, thanks for your support

I tried but it showed me the following message: /ErrorStdOut "C:\Users\cpivbalers\Music\FILE\PPM.au3"    
>Exit code: 0    Time: 3.782

I am not sure whats wrong as per I use the same code in different website for a link and it run perfectly

<a id="dgd2345589_ctl02_Hyperlink2" href="./CHVP/ComplaintProcess.aspx?module=2&amp;Option=Registration">EUFAPROCESS</a>

in the beggening of the html code it says " <script type="text/javascript">
 

Edited by titi9030

Share this post


Link to post
Share on other sites

#6 ·  Posted

Not sure how PPM.au3 is related to the code I posted above, did you try the code by itself without any additional includes?  

Share this post


Link to post
Share on other sites

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