Web scraping XML request how to work with hidden text?

fredrerik84

Active Member
Joined
Feb 26, 2017
Messages
383
Hi guys i'm still working on different web puller scripts.

So I just created a little web puller code here, The plan was to just make it with an visable IE to see that everything is working then make an XML req of it. Problem however is that there are some expandable rows that needs to be opened to get the desired information/links

Here is the code:

Code:
Set HTMLRows = HTMLDoc.getElementsByTagName("h3")
Set HTMLRows2 = HTMLDoc.getElementsByClassName("info-button button")
Set HTMLRows3 = HTMLDoc.getElementsByClassName("team team-a")


' Finds row and expands it 
For i = 0 To HTMLRows.Length
       On Error Resume Next
       Cells(j, "B").value = HTMLRows(i).innerText
       If HTMLRows(i).innerText = "Finland - Veikkausliiga" Then

          HTMLRows(i).Click
          Exit For
       End If
       j = j + 1
 Next i

 ' Get link to next page
Application.Wait (Now + TimeValue("0:00:01"))

For i = 0 To HTMLRows3.Length
   On Error Resume Next
   Cells(j, "E").value = HTMLRows3(i).innerText
   If HTMLRows3(i).innerText = "JJK" Then
      MsgBox "Found " & i
      Exit For
   End If
   j = j 
next i 

 HTMLRows2(i).Children(0).Click

My overall plan with this code was to make it as fast as possible so I really need this to work with an XMLHTTP60 req

Is it somehow possible to do all these steps trough an xml req? On my attempt here im stuck and I can not figure out how to handle the expandable row, anyone know how to tackle problems like this ?

Any help would be much appreciated :=9
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
for this sample I used this site:

Code:
If SDate <> Date Then
   Url = "http://uk.soccerway.com/matches/" & Format(SDate, "yyyy/mm/dd")
Else
   Url = "http://uk.soccerway.com/matches/"
End If

problem with IE is all the waiting makes the code rune somewhat slow..
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top