shahin
Active Member
After several trials and errors using ".queryselectorAll()", I could come up with an excellent solution that will exactly play the role like "for loop" does. I used "with block" instead of for loop to serve the purpose and it does the trick flawlessly. Thanks to Marc L, for teaching me the usage of "with block". Here is how I tried and got success:
Code:
Sub Torrent_Data()
Dim IE As New InternetExplorer, HTML As HTMLDocument
Dim post As Object
With IE
.Visible = False
.navigate "https://yts.am/browse-movies"
Do While .readyState <> READYSTATE_COMPLETE: Loop
Set HTML = .document
End With
With HTML.querySelectorAll(".browse-movie-bottom")
For I = 0 To .Length - 1
Cells(I + 1, 1) = .Item(I).querySelector(".browse-movie-title").innerText
Cells(I + 1, 2) = .Item(I).querySelector(".browse-movie-year").innerText
Next I
End With
IE.Quit
End Sub