Jump to content

Click button by value?


Klexen
 Share

Recommended Posts

http://v3.newzbin.com/

I'm just trying to have the script auto login...

Here is what I have.

CODE
#include <IE.au3>

$sURL = "http://v3.newzbin.com/"

$oIE = _IECreate($sURL, 0, 0, 0)

$HWND = _IEPropertyGet($oIE, "hwnd")

WinSetState($HWND, "", @SW_MAXIMIZE)

_IEAction($oIE, "visible")

_IELoadWait($oIE)

$iframe = $oIE

$iframe.document.getelementbyid ("username").value = "test"

$iframe.document.getelementbyid ("password").value = "*test"

$iframe.getelementbyid("???").click ; I would just put in ID of button but the button has no ID. Is there a way to click the button by value?

Link to comment
Share on other sites

  • Moderators

This should get you headed in the right direction.

#include <IE.au3>

$sURL = "http://v3.newzbin.com/"
$sUsername = "Username"
$sPassword = "Password"

$oIE = _IECreate($sURL)
$oForm = _IEFormGetCollection($oIE, 1)
$oUsername = _IEFormElementGetObjByName($oForm, "username")
$oPassword = _IEFormElementGetObjByName($oForm, "password")

_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)

_IEFormSubmit($oForm)
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...