LAMBERT99 Posted April 7, 2012 Share 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 ??? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 7, 2012 Developers Share 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. Link to comment Share on other sites More sharing options...
LAMBERT99 Posted April 7, 2012 Author Share 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 ! Link to comment Share on other sites More sharing options...
kylomas Posted April 8, 2012 Share 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 Link to comment Share on other sites More sharing options...
LAMBERT99 Posted April 8, 2012 Author Share 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) Link to comment Share on other sites More sharing options...
kylomas Posted April 8, 2012 Share 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 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 8, 2012 Share 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. Link to comment Share on other sites More sharing options...
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