Sign in to follow this  
Followers 0
daslick

I'm Feeling Lucky Button?

4 posts in this topic

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

How can I change this script to use the I'm Feeling Lucky button instead?

I looked in the google source code and I believe the button name is "btnI"

THANKS!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That seems very reasonable

...<br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td>...

Looks like it;s called 'btnI' to me too

EDIT:: never mind, I didn't get the Q, I thought you meant btnI didn't work...

Edited by crzftx

If I post a code or snippet, please tell me what I did wrong and/or what I can do better. Tell me my code/idea sucks, if it does. If I ask for help, refrain from only telling me to search the help file and/or the forums. I will search before asking, I just may not have searched with good keywords. If I say that I will look into something or fix something later, understand that I am most likely lying.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I haven't been able to get btn1 to work...

is this how it should be? - it doesn't work.... what is the name of the button/ or is there another way to get the button's name?

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "bnt1")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)
Edited by daslick

Share this post


Link to post
Share on other sites

This is all I have...

$Googlepage = _IEFormGetObjByName ($IE, "f")
                $Googlepageinput = _IEFormElementGetObjByName ($Googlepage, "q")
                _IEFormElementSetValue ($Googlepageinput, '"' & $site & '"')
                _IEAction($Googlepageinput, "focus")
                    Send("{TAB 2}")
                        Send("{Enter}")

This is a little better because it focuses on the input field first, but does anyone know how to get the element name of the ImFeelingLucky button?

Share this post


Link to post
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
Sign in to follow this  
Followers 0