First, download "wget.exe" and place it on the same folder of your .bat (or in any folder in your path).
Then use:
set urlPath=www.wikipedia.com
set urlFile=index.html
set urlPathOuput="C:\users\%username%\Desktop"
set urlFileOutput=WiKiPeDiA.txt
wget %urlPath%/%urlFile%
type %urlFile% > %urlPathOuput%\%urlFileOutput%
del %urlFile%
Change:
www.wikipedia.com to the web page folder
index.html to the web page file
C:\users\%username%\Desktop to a folder on your pc
WiKiPeDiA.txt to the file to be generated in the folder previously defined
STEP BY STEP
First, the code saves some variables. Then, wget downloads the file of the web page to the %cd% folder(here, it would download "www.wikipedia.com/index.html").
Then, the contents of the .html downloaded will be saved in a plain text file(here, a new file will be created in "C:\users\%username%\Desktop" (the desktop for the current user) called "WiKiPeDiA.txt").
Finally, the web page file is deleted.
Note:
If you want to save the contents of the file with the tags, this would be the code.
If what you want is to save the text displayed by the browser, you woul have to analise and filter it before saving it to the file.
I have never done that, but this is what I would do:
1. set linenumber=0
2. set characternumber=0
3. find the first "<", after linenumber&characternumber and save it in linenumber2 and the characternumber2.
4. echo everything from linenumber&characternumber to linenumber2&characternumber2.
5. find the first ">" after the previous "<" which was in linenumber2, characternumber2. Save it in linenumber and characternumber.
6. goto step 3
Hope it helped!