Followers 0

# Using IE.au3 to query a search engine

## 5 posts in this topic

Hi,

I have just started using the IE.au3 udf and would appreciate some help, this looks like a very powerful tool if I can learn how to drive it.

I would like to submit a query to a search engine and then "read" the search results to browse the URL's returned by the search engine.

I have found an example of how to query the search engine:

#include <C:\Program Files\AutoIt3\beta\Include\IE.au3>

$o_IE = _IECreate () _IENavigate ($o_IE, "http://au.altavista.com")

$o_SearchForm = _IEFormGetObjByName ($o_IE, "mfrm")

$o_query = _IEFormElementGetObjByName ($o_SearchForm, "q")
_IEFormElementSetValue ($o_query, "sydney plumber") _IEFormSubmit ($o_SearchForm)

Which works fine.

I sort of understand that I need to identify and manipulate objects to achieve results. The above code returns this URL as it's result:

http://au.altavista.com/web/results?itag=ody&q=sydney+plumber&kgs=1&kls=0

Using another example that reveals the objects on a page, I supplied the above URL, and observe the following output:

Form name: mfrm
itag    Type: hidden
q   Type: text
0   Type: submit
Form name: 0
itag    Type: hidden
kgs Type: hidden
q   Type: text
0   Type: submit

I'm afraid at this point I am stuck. I don't understand how to interpret the above results - so that I can use these "objects" to extract information from the search page results to be able to browse the URL's that were returned by the search engine.

If someone can offer some tips on how to identify and work with the relevant objects that would be great.

Thanks

VW

##### Share on other sites

Can you be more specific about what you want to do once you get the results page?

Dale

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

Automate input type=file (Related)

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

##### Share on other sites

Can you be more specific about what you want to do once you get the results page?

Hi Dale,

Well the search engine returns URL's that it believes matches the search criteria. I want to be able to "read" the results returned by the search engine and open then selected URL's in IE to examine those pages.

VW

##### Share on other sites

Hi Dale,

Well the search engine returns URL's that it believes matches the search criteria. I want to be able to "read" the results returned by the search engine and open then selected URL's in IE to examine those pages.

VW

Dale

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

Automate input type=file (Related)

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

##### Share on other sites

Hi Dale,

You're right, those functions are useful.

Thanks for the direction.

VW