Jump to content

html read hyperlink and take action, help


Recommended Posts

hi, i'm new to autoit

i'm really excited about its potencial, it's a awesome tool but i'm not a pro about coding so i need some help to get started

i wanna make a tool that opens an input box where i will place something to google find out as an exact phrase (exact phrase is a tool provided by google)

so..

i wanna open ie (7.0) and send it to www.google.co.uk

press tab on google page untill autoit reads the "advanced search" text

or the hyperlink "http://www.google.co.uk/advanced_search?hl=en"

wait for the advanced search page to be open

choose (somehow) the tab "with the exact phrase"

and search for the text i set on my first input box

i found something about reading html here

http://www.autoitscript.com/forum/index.ph...amp;hl=read+tab

but i really have no clue how to do it, or how to make autoit tab untill it "reads" advanced search

(a while cycle maybe, but how to "read" it?)

i'm very gratefull for any kind of help

thank you

Link to comment
Share on other sites

Welcome to the forum.

Try this code:

$in = InputBox("Autoit", "Type the words to search.")

$URL = StringReplace($in, " ", "+")

ShellExecute("http://www.google.co.uk/search?as_q=&hl=en&num=100&btnG=Google+Search&as_epq=" & $URL)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

on this code

Opt("WinWaitDelay", 6000)

Run("D:\Program Files\Internet Explorer\iexplore.exe")

WinWaitActive("Google - Windows Internet Explorer")

IELinkClickByText("Advanced Search")

i get this error

: ERROR: IELinkClickByText(): undefined function.

IELinkClickByText("Advanced Search")

and about herewasplato, i can't run it, it shows only a user call tips entries stuff on the menu :\

i totally feel like a noob.. but wait, that's what i'm :\

Link to comment
Share on other sites

  • Moderators

This should do what you are wanting...

#include <IE.au3>

$sURL = "http://www.google.co.uk/advanced_search?hl=en"
$sSearch = InputBox("Search", "What would you like to search for?")
If $sSearch == "" Then Exit

$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "f")
$oInput = _IEFormElementGetObjByName($oForm, "as_epq")
_IEFormElementSetValue($oInput, $sSearch)
_IEFormSubmit($oForm)
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...