shahin
Active Member
Hi there all! Good day. Hope you are doing well. I'm here to seek help to find "href". I have tried to write a code to parse "Title" and "href" of that Title. I can parse Title but in case of "href" I can't write that portion. Any help would be greatly appreciated. Here is the code I've written. Thanks in advance.
Html element for "href" is between the block I'm pasting.
Code:
Sub TorrentData()
Const URL = "https://www.yify-torrent.org/search/1080p/"
Dim http As New MSXML2.XMLHTTP60, html As New HTMLDocument
Dim P As Long, N As Long, L As Long, str As Variant
L = 2
http.Open "GET", URL, False
http.send
html.body.innerHTML = http.ResponseText
str = Split(http.ResponseText, "<span class=""name"">")
N = UBound(str)
For P = 1 To N - 1
Cells(L, 1) = Split(str(P), "<")(0)
''Cells(L, 2) = Here should be that code for "href"
L = L + 1
Next P
End Sub
Html element for "href" is between the block I'm pasting.
Code:
<a href="/movie/51608/download-iliza-shlesinger-confirmed-kills-2016-1080p-mp4-yify-torrent.html" target="_blank" title="Download Iliza Shlesinger: Confirmed Kills (2016) 1080p"><span class="play" style="display: none;"><span class="name">Iliza Shlesinger: Confirmed Kills (2016) 1080p</span></span><img src="//pic.yify-torrent.org/20170222/51608/iliza-shlesinger-confirmed-kills-2016-1080p-poster.jpg" alt="Iliza Shlesinger: Confirmed Kills (2016) 1080p"></a>