Jump to content

Recommended Posts

Posted

This is a Simply code to login into Google account.

$username = InputBox("Message","Type Acc")
$password = InputBox("Message","Type Pass")
$oIE = ObjCreate("InternetExplorer.Application") ;
$oIE.visible = True ; show ie
$oIE.Navigate("https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.com.vn/")
Sleep(10000)
$oIE.document.getElementById("Email").value=$username ; input acc
$oIE.document.getElementByName("Passwd").value=$password ; Input pass
$oIE.document.getElementById("signIn").click ; click button Login

  Quote

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\googlelogin.au3"

C:\Program Files\AutoIt3\googlelogin.au3 (8) : ==> The requested action with this object has failed.:

$oIE.document.getElementByName("Passwd").value=$password

$oIE.document.getElementByName("Passwd")^ ERROR

>Exit code: 1 Time: 15.042

and $oIE.document.getElementByName("Passwd").value=$password ; Input pass

didnt work.

is this a bug ?

Please help me.

Posted

There is no DOM method getElementByName - it is getElementsByName and it returns a collection, so you need to specify an item:

$username = InputBox("Message","Type Acc")
$password = InputBox("Message","Type Pass")
$oIE = ObjCreate("InternetExplorer.Application") ;
$oIE.visible = True ; show ie
$oIE.Navigate("[url="https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.com.vn/"]https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.com.vn/[/url]")
Sleep(10000)
$oIE.document.getElementById("Email").value=$username ; input acc
$oIE.document.getElementsByName("Passwd").Item(0).value=$password ; Input pass
$oIE.document.getElementById("signIn").click ; click button Login

Using the _IE functions from IE.au3 would likely simplify this for you.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted

That's because the name of the elelment on that site is "password", not "Passwd".

I don't think you have a very good understanding of what you are trying to do. Again, the _IE function will help you with examples and error handling. Please see the helpfile.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

  • Moderators
Posted

phamhoangthi,

And also please read the Forum Rules - particularly the bit that says:

"Do not discuss any of the following:

[...]

This includes forum or site auto-login methods". :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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