shahin
Active Member
Hi there! Hope you all are doing well. I got stuck at a certain stage writing some
code in VBA for the purpose of scraping and saving "Images" from a certain webpage to my file directory. Anyways, i wrote my code as far as i can. If anybody help me point out how i can accomplish my code to save the images in my file directory i would be indebted to him. By the way, i am pasting here my written code which only parse the link of the images i wanna save. Thanks in advance.
code in VBA for the purpose of scraping and saving "Images" from a certain webpage to my file directory. Anyways, i wrote my code as far as i can. If anybody help me point out how i can accomplish my code to save the images in my file directory i would be indebted to him. By the way, i am pasting here my written code which only parse the link of the images i wanna save. Thanks in advance.
Code:
Sub GetImage()
Dim xmlpage As New MSXML2.XMLHTTP60
Dim htmldoc As New HTMLDocument
Dim htmlas As Object, htmla As Object, html As Object
Dim x As Long
x = 2
xmlpage.Open "GET", "https://www.yify-torrent.org/search/1080p/", False
xmlpage.send
htmldoc.body.innerHTML = xmlpage.responseText
Set htmlas = htmldoc.getElementsByClassName("movie")
For Each htmla In htmlas
Set html = htmla.getElementsByTagName("img")(0)
Cells(x, 1).Value = html.src
x = x + 1
Next htmla
End Sub