Extract Images with Bat file
@echo off
setlocal
:: URL of the website
set "url=https://example.com"
:: Output file
set "outfile=imagelinks.txt"
:: Use PowerShell to fetch and extract <img src="">
powershell -command ^
"$html = Invoke-WebRequest '%url%' -UseBasicParsing; ^
$html.Links | Out-Null; ^
($html.ParsedHtml.getElementsByTagName('img') | ForEach-Object { $_.src }) | Out-File '%outfile%' -Encoding utf8"
echo Image links extracted to %outfile%
pause
Comments
Post a Comment