Sign in to follow this  
Followers 0
RogerRabbitsClone

looking for the correct _IE function

3 posts in this topic

so i wanted to create a really simple, almost retarded web crawler. i mean REALLY simple. i started with this:

$LowerLimit = 7
$UpperLimit = 777
$RandomNumber = Random($LowerLimit,$UpperLimit,1)

shellexecute ("iexplorer");google is homepage
sleep (3000)
send ($randomnumber & " xxx")
send ("{TAB}");send tab about 20 times
send ("{enter}")
sleep (3000)

then repeat the send tab, send enter a bunch of times hopefully click a bunch of external links. big surprise, this did not work to well.

heres my question, can i make this easier for myself of i just throw together some _IE functions? ive never used them, and i want to keep this a 1-2 day project because its part of something larger. i kinda blew through them but couldnt find one that explicitly said "this will find <a href...> and extract the link. is this something i have to do, or is there a UDF for this already?

or is _IEbodyreadHTML/text what im looking for and im just to stupid to apply them?

anything appreciated.


<--a good way to start you day

Share this post


Link to post
Share on other sites



Here is a "smart" way of going to the google homepage, and searching for something. Here is a little example of the _IE... functions that fits your needs. The most important thing you need to do when trying to find the IE object to interact with is finding the <form name=""> line in the source code and getting that name.

#include <IE.au3>
$value = 1
$oIE = _IECreate("http://google.com",1)
If $oIE = 0 Then
    ;failed instance of IE, just try again in most cases or manually kill all processes of IE. You can expand on this if you want.
    ConsoleWrite ("Failed _IECreate")
    Exit
EndIf
$oForm = _IEFormGetObjByName ($oIE, "f")    ;finds the form containing the search bar and button
$search = _IEFormElementGetObjByName ($oForm,"q")   ;the search bar
_IEFormElementSetValue ($search,$value)
$oButtons = _IETagNameGetCollection ($oIE, "input")
For $oButton In $oButtons
    If $oButton.name = "btnG" Then 
        _IEAction ($oButton, "click")
    EndIf
Next

Share this post


Link to post
Share on other sites

Just look at the example for _IELinkGetCollection in the helpfile.

Dale


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

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

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 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