LAMBERT99 0 Posted April 7, 2012 This is my second script slightly modified from the examples .... it works but it does not write the result in my script directory . (testt.txt) #include <IE.au3> Local $file = FileOpen(@ScriptDir &"testt.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf Local $oIE = _IECreate("http://cnn.com") Local $oLinks = _IELinkGetCollection($oIE) Local $iNumLinks = @extended MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks ;MsgBox(0, "Link Info", $oLink.href) FileWrite(@ScriptDir &$file, $oLink.href & @CRLF) Next FileClose($file) where i am doing misttake ??? Share this post Link to post Share on other sites
Jos 2,210 Posted April 7, 2012 (edited) Shouldn't that be : @ScriptDir&"testt.txt" ? Edited April 7, 2012 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
LAMBERT99 0 Posted April 7, 2012 Sorry ! the problem was not the script ! i saved the script somewhere else ..... the problem of a NEWBIE ... I have one question .... what about saving a web page with other name ?? is " _IEBodyWriteHTML " that works ??? having trouble with that ...... thanks ! Share this post Link to post Share on other sites
kylomas 416 Posted April 8, 2012 Lambert99, See inetget or inetread to save WEB pages kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
LAMBERT99 0 Posted April 8, 2012 Trying to save webpages by the following code ....... no sucess ! ?????? #include <Inet.au3> #include <IE.au3> Local $oIE = _INetGetSource('http://www.cnn.com') Local $sHTML = _IEDocReadHTML($oIE) MsgBox(0, "Document Source", $sHTML) Share this post Link to post Share on other sites
kylomas 416 Posted April 8, 2012 Lambert99, This is one way to do it. See the parms for a complete explanation. $url = 'http://www.cnn.com' $out_file = "c:tmpmy_out_file.txt" getter($url,$out_file) Func getter($in, $out) Local $s = InetGetSize($in, 1) Local $g = InetGet($in, $out, 1,1) Do Until InetGetInfo($g, 2) if InetGetInfo($g, 4) > 0 then MsgBox(0,'*** Error downloading ',$in) InetClose($g) EndFunc ;==>getter kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
somdcomputerguy 103 Posted April 8, 2012 Trying to save webpages by the following code ....... no sucess ! ?????? #include <Inet.au3> #include <IE.au3> Local $oIE = _INetGetSource('http://www.cnn.com') Local $sHTML = _IEDocReadHTML($oIE) MsgBox(0, "Document Source", $sHTML) Try this: #include <Inet.au3> Local $oIE = _INetGetSource('http://www.cnn.com') MsgBox(0, "Document Source", $oIE) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites