locked
Automate click on form javascript via PowerShell RRS feed

  • Question

  • Dear,

    I'm trying to automate a click on a javascript form result of the call below and would like any hint that might help me in the solution.
    $IE= New-Object -ComObject "InternetExplorer.Application"
    $IE.Navigate2("http://xxxxxxx.cxcxcxcxc.com.br/login")
    while ($IE.Busy) {Start-Sleep -Milliseconds 2000}
    $IE.Visible=$true
    $IE.FullScreen=$true
    $IE.Document.getElementById("user_session_email").value="user@xxxxxxxx.xxx.xx"
    $IE.Document.getElementById("user_session_password").value="xxxxxxxxxxxx"
    $Click=$IE.Document.getElementsByTagName("button") | Where-Object {$_.type -eq 'submit'}
    $Click.click();
    while ($IE.Busy) {Start-Sleep -Milliseconds 5000}
    $IE.Document.getElementById("button_begin_period_one").click();
    

    Monday, April 9, 2018 3:09 PM

All replies

  • How do you know the website allows that?  Most sites cannot logon via submitting the main form.  That would invite bots in too easily.


    \_(ツ)_/

    Monday, April 9, 2018 3:24 PM
  • Hi Jrv.

    Until I understand, but in my case my problem is not being in the login form, because in this I have already been able to automate the login. My problem is being in element ID "button_begin_period_one", this one generates a form asking for confirmation, here is my problem.
    I need to confirm yes or no!
    Monday, April 9, 2018 3:42 PM