If you are using windows, it will be a lot easier using batch and vbscript
This will create a text file in your desktop containing all the links to your desired webpages
Just Make sure to leave at least a single empty line at the end of the batch file after the last line in the code, or it will not work.
@Echo OFF
Color 0E
Rem Setting Variables Here
SET "IMGname=nsc-logo.jpg" // Word To Search For in the HTML Source
SET "RangeStart=99800" // Start Range Number
SET "RangeEnd=99999" // End Range Number
SET "LogFile=%userprofile%\Desktop\beaconlive.log" // Log file That hold the Valid URLs
SET "OutFile=%temp%\HTMLsource.txt" // Temp File Where we save the source
Rem Delete Files from Prevoius Run
IF Exist "%Temp%\Download.vbs" DEL /F /Q "%Temp%\Download.vbs" >NUL
IF Exist "%OutFile%" DEL /F /Q "%OutFile%" >NUL
IF Exist "%LogFile%" DEL /F /Q "%LogFile%" >NUL
Echo.&Echo.&Echo Downloading ...
Rem Getting The Number sequance and Passing the URL to The Download Script
SETLOCAL EnableDelayedExpansion
For /L %%A In ( %RangeStart% 1 %RangeEnd% ) Do (
Rem Download URL
CALL :Download "http://media.beaconlive.com/viewitem?bckt=%%A"
Rem Search In the Source for the IMGname, if found log it in the log file
For /F "delims=" %%z In (' Findstr "%IMGname%" "%OutFile%" ') Do (
IF NOT "%%z" == "" Echo Found At: http://media.beaconlive.com/viewitem?bckt=%%A>>"%LogFile%"
)
Rem Delete OutFile
Del /F /Q "%OutFile%" >NUL
)
Rem All Done, End Message
Color 0A
Echo.&Echo.&Echo.&Echo.&Echo.&Echo.&Echo.&Echo.&Echo.&Echo.
Echo All Done!
Echo Check Your Log File
Pause >Nul
Exit /B
:Download <URL>
IF NOT EXIST "%Temp%\Download.vbs" (
(For /F "tokens=1*" %%A In ('FINDstr "^:Download: " ^< "%~F0"') DO Echo.%%B)>"%Temp%\Download.vbs"
)
CScript //nologo "%Temp%\Download.vbs" "%~1" "%OutFile%"
GOTO :EOF
:Download: Set objArgs = WScript.Arguments
:Download: url = objArgs(0)
:Download: pix = objArgs(1)
:Download: With CreateObject("MSXML2.XMLHTTP")
:Download: .open "GET", url, False
:Download: .send
:Download: a = .ResponseBody
:Download: End With
:Download: With CreateObject("ADODB.Stream")
:Download: .Type = 1 'adTypeBinary
:Download: .Mode = 3 'adModeReadWrite
:Download: .Open
:Download: .Write a
:Download: .SaveToFile pix, 2 'adSaveCreateOverwrite
:Download: .Close
:Download: End With
REM ===================================================
REM IMPORTANT : Must Leave Empty Line After This Line
REM ===================================================