Sign in to follow this  
Followers 0
Astormooke

I need some help

5 posts in this topic

k this is probably a really noob thing to want but I need a bot to research a topic of my choice.... now I can get to the point that I open google and search a topic but I need to get it to get the web links and use inet get to get the webpage. Here is the code so far......

#include <IE.au3>
HotKeySet("`","topic")

While 1
    Sleep(100)
WEnd

Func topic()
$oIE = _IECreate("www.google.com")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 1)
$research = InputBox("What to research?","What do you want to research?")
_IEFormElementSetValue ($oQuery, $research)
_IEFormSubmit ($oForm)
EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This was the best way I could find...

#include <IE.au3>
HotKeySet("`", "topic")

_IEErrorHandlerRegister()
_IEErrorNotify(0)

While 1
    Sleep(100)
WEnd

Func topic()
    $oIE = _IECreate("www.google.com")
    $oForm = _IEFormGetCollection($oIE, 0)
    $oQuery = _IEFormElementGetCollection($oForm, 1)
    $research = InputBox("What to research?", "What do you want to research?")
    _IEFormElementSetValue($oQuery, $research)
    _IEFormSubmit($oForm)
    $oRes = _IEGetObjById($oIE, "res")
    $oDivs = _IETagNameGetCollection($oRes, "DIV")
    For $oDiv In $oDivs
        If String($oDiv.className = "g") Then
            $oTemp = $oDiv.firstChild
            If String($oTemp.className = "r") Then
                $oTemp = $oTemp.firstChild
                If String($oTemp.className = "1") Then
                    $sHREF = String($oTemp.href)
                    If $sHREF <> "" Then
                        ConsoleWrite($sHREF & @CR)
                    EndIf
                EndIf
            EndIf
        EndIf
    Next
EndFunc   ;==>topic
Edited by big_daddy

Share this post


Link to post
Share on other sites

Thank you so much.......

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thank you so much.......

You're welcome! Edited by big_daddy

Share this post


Link to post
Share on other sites

lol

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