Jump to content

Gmail Acces Through Ie.au3


Recommended Posts

  • Moderators

http://gmail.google.com/

Anyone has a idea how to use IE.au3 to fill in the forms? I feel like i have tried everything.

#include <IE.au3>

$sUsername = "Your Username"
$sPassword = "Your Password"

$oIE = _IECreate("http:\\mail.google.com")

; get pointers to the login form, then username and password fields
$oform = _IEFormGetObjByName($oIE, "gaia_loginform")
$ologin = _IEFormElementGetObjByName($oform, "Email")
$opassword = _IEFormElementGetObjByName($oform, "Passwd")

; Set field values and submit the form
_IEFormElementSetValue($ologin, $sUsername)
_IEFormElementSetValue($opassword, $sPassword)
_IEFormSubmit($oform)
Link to comment
Share on other sites

  • 4 months later...

No problem, glad I could help.

Hi,

But now, when I got into my acount page, how do I start compose new message automaticly.

I can't find the form elemet name for using _IEFormGetObjByName. View source just doesn't work.

Thanks....

Link to comment
Share on other sites

Try using

_IEBodyReadHTML ($oIE)

to see the real source. I learned from Dale view source doesn't always give the info you need, but that line of code will.

Edited by JaySquared

Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Link to comment
Share on other sites

Hi,

The line - _IEBodyReadHTML ($oIE) did gave me the source of the login page to Gmail,

but when I try doing that after I loged into the acount, it just gave me nothing.

Im using this code to login to my Gmail acount, and now I want to use the "Compose Mail" button...

Whitch commands should I use?

#include <IE.au3>

Dim $mac_array[7]

;name of the user that should be modified

$user = "user"

;routers password:

$Password= "password"

;Log into the router's web-interface.....

$oIE = _IECreate()

_IENavigate($oIE, "www.gmail.com")

;wait for updated page

_IELoadWait($oIE,50)

;get pointers to the login form and password field

$o_form = _IEFormGetObjByName($oIE, "gaia_loginform")

$o_login = _IEFormElementGetObjByName($o_form, "Email")

$o_password = _IEFormElementGetObjByName($o_form, "Passwd")

;Set field values and submit the form

_IEFormElementSetValue($o_login, $user)

_IEFormElementSetValue($o_password, $Password)

_IEFormSubmit ($o_form)

$NewHtml=_IEBodyReadHTML ($oIE)

FileWrite("Gmail.txt",$NewHtml)

Exit

Thank.

Link to comment
Share on other sites

Try a _IELinkClickByText function first. If that doesn't work,

#include <IE.au3>
$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
    MsgBox(0, "Link Info", $oLink.href & " text:" & $oLink.innerText)
Next

This topic was made before the IE.au3 UDF was described in the helpfile, when it was described I learned alot from the helpfile, so now I am basically a expert at this. lol ^^

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