Jump to content

Recommended Posts

Posted

hello all

I use _IEBodyReadText to get the source text of a webpage and then

put the source text into a text file by FileWrite

but the text will be in one line

I want the text file to be the same as the source html

thanks for any help

Posted

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")

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted (edited)

sorry i was using _INetGetSource with text files

thanks boththose

it 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 by MAS
Posted (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 by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...