Jump to content

Need help clicking objects in web page


Guest
 Share

Recommended Posts

Hey!

How do I make this work? Mouse must click google's search bar

$IE = ObjCreate("InternetExplorer.Application")
$IE.visible = True

$IE.navigate("google.com")

while($IE.busy)
WEnd

sleep(2000)

$inputs = $IE.document.getElementsByTagName("input")

for $input in $inputs
   if $input.getAttribute("name") = "btnK" then
      $rightinput = $input
   EndIf


Next

$rightinput.click()

Exit

Thanks alot!

Link to comment
Share on other sites

#include <IE.au3>
$oIE = _IECreate("google.com",1)
$oInputs = _IETagNameGetCollection($oIE,"input")
For $oInput In $oInputs
    If $oInput.Name = "btnk" Then
        _IEAction($oInput,"focus")
        _IEAction($oInput,"click")
        ConsoleWrite("clicked!" & @CRLF)
        ExitLoop
    EndIf
Next

This script doesn't actually 'do' anything, since there is no search criteria populated...you can tell it's clicking the proper button due to the focus though.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...