Trying to perform Advance search in Google Advance search:
http://www.google.com/advanced_search
How to do multiple entry to perform a list of search objects (Firefox, Chrome, Opera,,,,) in different sites i.e. www.google.com or www.yahoo.com
How to get multiple result in th site to a file.
#include <File.au3> #include <String.au3> #include <Array.au3> #include <IE.au3> #include <Excel.au3> $ROW = 1 $COL = 1 $file = FileOpen(@WorkingDir&"\LogNames.txt", 0) Local $oExcel = _ExcelBookNew() ;Create new book, make it visible ; Read in lines of text until the EOF is reached While 1 $LogLine = FileReadLine($file) If @error = -1 Then ExitLoop $ROW += 1 $LogCode = StringMid ($LogLine, 1, 20); Extract LogCode $oIE = _IECreate ("http://www.google.com/advanced_search", 0) $oForm = _IEFormGetObjByName ($oIE, "mainform") $oText = _IEFormElementGetObjByName ($oForm, "this exact wording or phrase") _IEFormElementSetValue($oText, $LogCode) $oText2 = _IEFormElementGetObjByName ($oForm, "Search within a site or domain") _IEFormElementSetValue($oText2, "www.google.com") $netinfo = _IEFormSubmit ($oForm) $inet = InetRead($netinfo) $string = BinaryToString($inet) $space_replace = StringReplace($string,' ','') $string_Between_Data = _StringBetween($space_replace, 'id=resultStats>About', 'results<nobr>') ; _ArrayDisplay($$string_Between_Data, 'Default Search') $string_Between_Percent = _StringBetween($space_replace, 'results<nobr>(', 'seconds) ') $string_Between_Result = _StringBetween($space_replace, 'id=resultStats>About', 'results<nobr>') ; How to extract a paragraph? ; _ArrayDisplay($$string_Between_Data, 'Default Search') MsgBox(0,'',$string_Between_Data[0]) ;wRITE TO EXCEL FILE ;Declare the Array Local $aArray[$ROW][2] = [[$LogCode, $string_Between_Data]] Local $aArray[$ROW][3] = [[$LogCode, $string_Between_Percent]] Local $aArray[$ROW][3] = [[$LogCode, $string_Between_Result]] _ExcelWriteSheetFromArray($oExcel, $aArray, $ROW, 1, 0, 0) ;0-Base Array parameters Wend; end of While SoundPlay("C:\Windows\media\chimes.wav",1) MsgBox(4096,"Done!","All Log data files have been created!") MsgBox(0, "Exiting", "Press OK to Save File and Exit") _ExcelBookSaveAs($oExcel, @TempDir & "\EXCELTemp.xls", "xls", 0, 1) _ExcelBookClose($oExcel) ; Separate Text file LogNames.txt ; LogNames.txt ; Firefox ; Chrome ; Internet Explorer ; Safari ; Opera
Testing code not working well. Please help.
Expected ResultBookTraget.xls
Edited by MaoMao, 28 November 2011 - 11:17 AM.




