Code: Select all
Option Explicit
'initiate iMacros instance
Dim iim1, iret
set iim1 = CreateObject ("imacros")
iret = iim1.iimInit()
'navigate to youtube frontpage
Dim macro
macro = "CODE:"
macro = macro + "VERSION BUILD=6200707 " + vbNewLine
macro = macro + "TAB T=1 " + vbNewLine
macro = macro + "TAB CLOSEALLOTHERS " + vbNewLine
macro = macro + "URL GOTO=http://www.youtube.com/ " + vbNewLine
iret = iim1.iimPlay(macro)
'loop through videos
Dim counter
counter = 0
do while not iret < 0
counter = counter + 1
macro = "CODE:"
macro = macro + "TAG POS=R"+Cstr(counter)+" TYPE=IMG ATTR=CLASS:vimg120&&TITLE:*&&HREF:*&&NAME:*&&ALT:video&&SRC:* " + vbNewLine
macro = macro + "PROMPT Current<SP>URL:<SP>{{!URLCURRENT}}" + vbNewLine
macro = macro + "BACK"
iret = iim1.iimPlay(macro)
loop
'end
msgbox "End. We'll close the iMacros browser and exit the VBS script."
'close iMacros instance
iret = iim1.iimExit()
' exit script
Wscript.Quit()
Code: Select all
SET !EXTRACT {{!URLCURRENT}}
SAVEAS TYPE=EXTRACT FOLDER=myFolder FILE=myFile.csv