Jump to content

Need help clicking a link within IE - (Moved)


mknope
 Share

Recommended Posts

Hello,

For the following URL (https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F), I am trying to click the button called "Log in with CernerCare". I have tried many different methods but none have worked. Things I have tried include:

    Local $oDivs = _IETagNameGetCollection($oIE, "div")
        For $oDiv In $oDivs
        If $oDiv.ClassName = "provider__logo" Then _IEAction($oDiv, "click")
        MsgBox($oDiv)
        Next

----------------------------

_IELinkClickByIndex($oIE,6)

--------------------------

_IELinkClickByText($oIE,"Log in with CernerCare")

Link to comment
Share on other sites

  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

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.
  :)

Link to comment
Share on other sites

Works :

#include <Constants.au3>
#include <IE.au3>

Opt ("MustDeclareVars", 1)

Global $oIE = _IECreate ("https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F")
Global $oTags = _IETagNameGetCollection ($oIE, "a")
For $oTag in $oTags
  If $oTag.className = "button provider provider--cernercare" Then
    $oTag.click ()
    MsgBox ($MB_SYSTEMMODAL,"","Found")
    ExitLoop
  EndIf
Next

 

Link to comment
Share on other sites

I am seeing the following in the console when I try your code:

 

--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IETagNameGetCollection, $_IESTATUS_InvalidObjectType
"C:\Visual Studio\AIS\AIS Package Management\AutoIT\Install Hist Export.au3" (8) : ==> Variable must be of type "Object".:
For $oTag in $oTags
For $oTag in $oTags^ ERROR
>Exit code: 1    Time: 2.647

Link to comment
Share on other sites

@mknope You shouldn't be receiving these errors from _IECreate, so I suspect there is something unique with your setup that is causing that issue. You can try working around it with an additional call to _IEAttach --

#include <IE.au3>

Opt ("MustDeclareVars", 1)

_IECreate ("https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F", 0, 1, 0)
Local $oIE = _IEAttach("businesslogin.cerner.com", "url")
_IELoadWait($oIE)
_IELinkClickByText($oIE, "Log in with CernerCare")

 

Link to comment
Share on other sites

I was able to just get this to work after changing some of the settings within IE.

$oIE = _IECreate ("https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F")
_IELoadWait($oIE)
_IELinkClickByText($oIE, "Log in with CernerCare")

Link to comment
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
 Share

  • Recently Browsing   0 members

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