shahin
Active Member
Hi there!! Hope you all are well. I got stuck at some point creating a parser. I have already made it and it is running smoothly. However, the problem I'm facing is that I can't find any element triggering to the next page except for clicking the button. As I'm using xmlhttp method, I can't avail that click button option. Any help would be a great relief for me. Thanks in advance. Here is the code:
Code:
Sub ExtractingEmail()
Const url = "http://www.sportfocus.com/comdir/keyword.cfm?cid=11&maj=cricket&ckid=102&min=clubs%20and%20Associations&kid=860&key=England"
Dim http As New MSXML2.XMLHTTP60, html As New HTMLDocument
Dim Posts As Object, Post As Object
Dim x As Long, i As Long, Z As Long
x = 2
http.Open "GET", url, False
http.send
html.body.innerHTML = http.responseText
Set Posts = html.getElementsByClassName("dirListingPlus")
For Each Post In Posts
On Error Resume Next
Cells(x, 1) = Post.getElementsByTagName("a")(0).innerText
Cells(x, 2) = Split(Post.getElementsByTagName("a")(1).href, ":")(1)
x = x + 1
Next Post
End Sub