AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending keystrokes to a login box on a web page
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
steveiwonder



Joined: 16 Nov 2004
Posts: 82

PostPosted: Mon Mar 07, 2005 3:35 pm    Post subject: Sending keystrokes to a login box on a web page Reply with quote

Would anyone be able to help me here,?
for example,
Someone wants to write a script to log you into ummm... Yahoo or something
can you tell AHK to send keystrokes to a certain edit box on there website?
Like
http://login.yahoo.com/config/login?.src=www&.done=http://www.yahoo.com
You wanna send your Username to the Yahoo! ID box,
how can i send my username to that and that only

any idea's?
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Mon Mar 07, 2005 4:02 pm    Post subject: Reply with quote

Since the ID box is auto-focused on load you can do something simple like sending the keys:
Code:
Run, http://login.yahoo.com/config/login?.src=www&.done=http://www.yahoo.com
Sleep, 750 ;adust this to your comp./net speed
Send, emailaddress@yahoo.com{tab}password{enter}

_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
steveiwonder



Joined: 16 Nov 2004
Posts: 82

PostPosted: Mon Mar 07, 2005 10:59 pm    Post subject: Reply with quote

Thats kinda what i needed but w/o using sleep, wondered if u could tell it to send to that edit box spacifically...? or is that not possible
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Mon Mar 07, 2005 11:12 pm    Post subject: Reply with quote

Try:
Code:
Run, http://login.yahoo.com/config/login?.src=www&.done=http://www.yahoo.com
WinWait, Yahoo! Login - Microsoft Internet Explorer
WinActivate, Yahoo! Login - Microsoft Internet Explorer
WinWaitActive, Yahoo! Login - Microsoft Internet Explorer
Send, emailaddress@yahoo.com{tab}password{enter}

_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Mar 08, 2005 1:40 am    Post subject: Reply with quote

steveiwonder wrote:
send to that edit box spacifically...? or is that not possible
If you haven't already, try ControlSetText and if that doesn't work, ControlSend.
Back to top
View user's profile Send private message Send e-mail
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Tue Mar 08, 2005 2:29 am    Post subject: Reply with quote

Chris wrote:
steveiwonder wrote:
send to that edit box spacifically...? or is that not possible
If you haven't already, try ControlSetText and if that doesn't work, ControlSend.
Chirs, this wont work (I've tried) because the IE window has it's own ClassNN; component's such as edit, static, etc don't exist (or am I trying it wrongly?).
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
jazzyjas



Joined: 13 Mar 2005
Posts: 1

PostPosted: Sun Mar 13, 2005 9:13 pm    Post subject: Maybe we can force to send a password unvisibly..? Reply with quote

The thing is - I have tried to logon to other websites -
and I just can't get the focus on the login field!

I'd rather pass the whole uri to IE and tell autohotkey
to use the method post to send the data and
not the method get!

To be more precisely, let's assume I have a webside called
xyz.com. I am user:joe and have pwd:password.

I'd like to write sth. like
run, http://www.xyz.com/admin.php?user=joe&pwd=password&method=post
into autohotkey to avoid letting anybody see
my password!

The risk to loose the password by letting autohotkey type it
- is in my opinion too high! I tried so often and there are so
many possibilites of disturbance that my password was
written everywhere but not in the textbox.

I would prefer to avoid it somehow!

What do you think? Is there a possibility
to automate internet password logins
without ever showing up the password?

Greetings

JAZZYJAS.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Mon Mar 14, 2005 2:19 am    Post subject: Reply with quote

It seems the key is to get the focus set to the right field/control so that the password will be masked when typed. In some browsers, you can improve the reliability of this by using the Find function to select a word that occurs right before the target field, and then Send {Tab} to set the focus.

There are also some posts on the forum about how to use a one-line javascript command, pasted into the address bar, to automate certain kinds of form actions.
Back to top
View user's profile Send private message Send e-mail
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Mon Mar 14, 2005 9:34 am    Post subject: Reply with quote

This was a very important topic to me as well. I always wondered how some programs such as Roboform (www.roboform.com) which fills forms and passwords worked (guys any thoughts?).

Anyways, If you really want to do things "behind the scenes" and use a method spiders and other programs use:

http://curl.haxx.se/

curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

I've spend a lot of time trying to get it to work for my needs and even had to hire a consultant - anyways, it works well without too much hassle UNLESS you need cookies involved - thats where it starts to get hard.

----

However, if you don't need such a "professional" method, I use the Ctrl F (then type a search text preceeding the form you want to have focus) then hit {TAB} as Chris mentioned.



Good luck.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Serenity



Joined: 08 Nov 2004
Posts: 892

PostPosted: Mon Mar 14, 2005 9:35 am    Post subject: Reply with quote

Jazzyjas, you might find this thread of interest.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
cornell2
Guest





PostPosted: Fri Mar 18, 2005 8:44 am    Post subject: Finding specific input box Reply with quote

This is a big issue for me too .. I just cannot believe that Autokey doesn't too this (or at least it is not obvious).

For my use, I just want Autokey to bring me to a specific web page, and then go to the 3rd text-input field and paste something.

I am having a helluva time making it do this .. and cannot believe that it is this complex a task (where I either have to kludge it by doing a ctrl-F and search, or javascript).

Can anyone here set me straight?

Thanks
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Mar 19, 2005 3:59 am    Post subject: Re: Finding specific input box Reply with quote

cornell2 wrote:
For my use, I just want Autokey to bring me to a specific web page, and then go to the 3rd text-input field and paste something.
I don't know of a single method that works identically on all major browsers.

But perhaps such features will be added someday, especially if an expert comes along to explain a workable approach.
Back to top
View user's profile Send private message Send e-mail
cornell2



Joined: 18 Mar 2005
Posts: 166

PostPosted: Sat Mar 19, 2005 8:47 pm    Post subject: Re: Finding specific input box Reply with quote

Chris wrote:
cornell2 wrote:
For my use, I just want Autokey to bring me to a specific web page, and then go to the 3rd text-input field and paste something.
I don't know of a single method that works identically on all major browsers.

Well, I'd just be happy if it worked on *my* browser! IE6

: )
Back to top
View user's profile Send private message
daonlyfreez



Joined: 16 Mar 2005
Posts: 745
Location: Berlin

PostPosted: Sun Mar 20, 2005 12:20 am    Post subject: Reply with quote

Maybe you could try to parse the page first, get the existing elements on page thru JavaScript and then fill in the form fields as needed? This could all be done thru JavaScript...

You can access the elements by this kind of syntax:

document.forms[0].elements[0].value

More on elements on a web page
_________________
(sorry, homesite offline atm)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Guest






PostPosted: Sun Mar 20, 2005 12:41 am    Post subject: Reply with quote

daonlyfreez wrote:
Maybe you could try to parse the page first, get the existing elements on page thru JavaScript and then fill in the form fields as needed? This could all be done thru JavaScript...

You can access the elements by this kind of syntax:

document.forms[0].elements[0].value

More on elements on a web page


Actually I got it done ... but to all that suggested Javascript etc .. I am sure there are a lot of other ways to accomplish this seemngly simple task (including just paying someone to type the keys everytime they see the right fields to enter). Since I am using this autohotkey utility, and participating in the autohotkey community - the desire was to investigate and autohotkey solution (for a pretty straightforward and common issue).

Just like the other folks who were asking for a solution above - if I wanted to learn Javascript (or another tool) then I would not be using autohotkey.

I don't mean for this to sound negative or ungrateful (I am neither). But it is a little like getting a new samsung phone and spending time programming the autodial buttons only to find that they only accept 6 digits (when you normally need 7-10). And when you call samsung to get help, all the support folks merely suggest you go buy a nokia phone.

: )

Thanks all,
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group