MAS Posted April 17, 2012 Share Posted April 17, 2012 hello allI use _IEBodyReadText to get the source text of a webpage and thenput the source text into a text file by FileWritebut the text will be in one lineI want the text file to be the same as the source htmlthanks for any help Link to comment Share on other sites More sharing options...
iamtheky Posted April 17, 2012 Share Posted April 17, 2012 Post your code, or at least the site you are having issues with. My test script with techdirts wall of text works fine. #include <IE.au3> $oIEtech = _IECreate("www.techdirt.com" , 0 , 1) $sText = _IEBodyReadText($oIEtech) FileWrite ("test.txt" , $sText) run ("notepad " & @Scriptdir & "test.txt") ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
MAS Posted April 17, 2012 Author Share Posted April 17, 2012 (edited) sorry i was using _INetGetSource with text files thanks boththoseit works fine#include <INet.au3> $sText = _INetGetSource("http://www.catonmat.net/download/awk.cheat.sheet.txt") FileWrite ("test.txt" , $sText) run ("notepad " & @Scriptdir & "test.txt")The problem with only text files with _INetGetSource Edited April 17, 2012 by MAS Link to comment Share on other sites More sharing options...
iamtheky Posted April 17, 2012 Share Posted April 17, 2012 (edited) Think it may be your editor of choice, moreso than the get. may need to adjust the path to wordpad, but this seems to keep the formatting just fine. #include <INet.au3> If fileexists (@ScriptDir & "test.txt") Then FileDelete(@ScriptDir & "test.txt") $sText = _INetGetSource("http://information.co.nf/text.txt") FileWrite ("test.txt" , $sText) run ("C:Program FilesWindows NTAccessorieswordpad.exe " & '"' & @Scriptdir & 'test.txt' & '"') ; Exit Edited April 17, 2012 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
MAS Posted April 17, 2012 Author Share Posted April 17, 2012 Yes It's now works very well with txtsthanks very much boththose 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