Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Programming (http://www.go4expert.com/forums/programming-forum/)
-   -   Batch Script + Wget to download web pages (http://www.go4expert.com/forums/batch-script-wget-download-web-pages-t23228/)

Cleptography 7Sep2010 02:46

Batch Script + Wget to download web pages
 
This simple script uses wget.exe to download and covert links from a web page.
Wget has much more advanced options, than the one I use in this script, but it serves my general purpose.

Code:

@echo off
 setlocal

:Check_Program_Path
if exist "%ProgramFiles%\GnuWin32\bin\wget.exe" goto :Check_Command_ARG
goto :ERROR_1

:Check_Command_ARG
if [%~1]==[] goto :ERROR_2

:: ELSE---
:Set_VARS
set Use_WGET="%ProgramFiles%\GnuWin32\bin\wget.exe"
set With_Arguments=-p --convert-links %~1

:Use_WGET_2_Download_Page
%Use_WGET% %With_Arguments%
goto :EOF

:ERROR_1
echo.Wget.exe was not found in your path!!!
goto :EOF

:ERROR_2
echo.No Address was specified!!!
echo.
echo.USAGE: DLPage google.com
goto :EOF



All times are GMT +5.5. The time now is 01:09.