Astormooke Posted July 1, 2007 Posted July 1, 2007 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
Moderators big_daddy Posted July 2, 2007 Moderators Posted July 2, 2007 (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 July 2, 2007 by big_daddy
Moderators big_daddy Posted July 2, 2007 Moderators Posted July 2, 2007 (edited) Thank you so much.......You're welcome! Edited February 2, 2008 by big_daddy
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now