nhd1986 Posted April 22, 2006 Posted April 22, 2006 can anyone help me to create a code which is about finding links on a webpaper thanks
Valuater Posted April 22, 2006 Posted April 22, 2006 (edited) Lesson 15 from "Welcome to Autoit 1-2-3"... in my signature belowexpandcollapse popup; demonstration to find chracters that change between to standard points ; or just find a string #include <IE.au3> #Region --- IE-Builder generated code Start --- $oIE = _IECreate () ;------------- User input -------------- _IENavigate ($oIE, "http://www.autoitscript.com/"); web address $Find = "LZ"; my info shows after this line... or just find this line $Before = "comp"; my info shows before this line... or set as "" ; ------------ End User input ------------- Sleep(1000) $body = _IEBodyReadHTML ($oIE) $sloc = @TempDir & "\stest.txt" FileDelete($sloc) FileWrite($sloc, $body) $sfile = FileOpen($sloc, 0) $num = 0 While 2 $num = $num + 1 $sline = FileReadLine($sfile, $num) If @error Then MsgBox(262208, "Fail", "The string was NOT found ") FileClose($sfile) Exit EndIf If StringInStr($sline, $Find) Then MsgBox(64, "Success", "The string " & $Find & " was found " & @CRLF & " on line # " & $num, 5) If $Before = "" Then ExitLoop $Found = stringbetween($sline, $Find, $Before) MsgBox(64, "Found", "The string is " & $Found & " ", 5) ExitLoop EndIf WEnd Func stringbetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIf EndFunc ;==>stringbetween #EndRegion --- IE-Builder generated code End ---this will do the trick, howeverto get all the "stuff" you need and learn how to use it....go herehttp://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited April 22, 2006 by Valuater
iverson_est Posted April 22, 2006 Posted April 22, 2006 ... or check here http://www.autoitscript.com/forum/index.php?showtopic=13398
nhd1986 Posted April 22, 2006 Author Posted April 22, 2006 (edited) thanks bro Valuater, i was understanding about ur code you wanted to write a webpaper code to a text file then search someone on it. i know IE = internet explorer, so if i use ur code with firefox or other webbrowser, can it run? , i know i'm noob, hope u help me so much Thanks for help me Edited April 22, 2006 by nhd1986
elgabionline Posted April 22, 2006 Posted April 22, 2006 thanks bro Valuater, i was understanding about ur code you wanted to write a webpaper code to a text file then search someone on it.i know IE = internet explorer, so if i use ur code with firefox or other webbrowser, can it run? , i know i'm noob, hope u help me so muchThanks for help meNot working in Firefox, because the Internet Explorer Automation UDF Library for AutoIt take those Objects of Internet Explorer (does it sound redundant, not?) lol.
nhd1986 Posted April 22, 2006 Author Posted April 22, 2006 thanks bro what code can help my code which know a webpaper load full(100%) or not ?_?
elgabionline Posted April 22, 2006 Posted April 22, 2006 thanks bro what code can help my code which know a webpaper load full(100%) or not ?_? take a look to this: ; Function Name: _IELoadWait() ; Description: Wait for a browser page load to complete before returning ; Parameter(s): $o_object - InternetExplorer.Application object ; $i_delay - wait this many milliseconds before checking status ; Requirement(s): AutoIt3 Beta with COM support (post 3.1.1) ; Return Value(s): On Success - Returns an object variable pointing to ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Dale Hohm ; ;=============================================================================== ; Func _IELoadWait($o_object, $i_delay = 0) If IsObj($o_object) Then $s_oname = ObjName($o_object) Sleep($i_delay) While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4) <===== Here this can help you... Sleep(100) WEnd SetError(0) Return 1 Else SetError(1) Return 0 EndIf EndFunc ;==>_IELoadWait
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