Web Scape

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,104
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello

I need to get the data from this webpage

Meeting Results

in a specific layout

if you see there are 12 races on this page.
so i would like 12 lines of data as setout below. I have given the class names as help

"track", "grade", "date", "datetime", "essential greyhound" 1-6(in trap order if possible), "first essential fin" 1-6, "sp" 1-6


I can actually do the above, but my problems come when in some races, perhaps non runners means that maybe only 5 runners, then all of my code goes wrong. I ma not able to account for the numbers going out of sync.

part of my code below so you can see my approach.

BTW, dont have to use ie, but i dont know any other way.

Code:
Sub IE_getdogs()
    Dim ie As InternetExplorer
    Set ie = New InternetExplorer
        With ie
            .Visible = False
            .Navigate "http://www.gbgb.org.uk/resultsMeeting.aspx?id=14000"
            While .Busy Or .ReadyState <> READYSTATE_COMPLETE: DoEvents: Wend
            Set HTMLdoc = .Document
        End With
        Set dogname = HTMLdoc.getElementsByClassName("essential greyhound")
        Set trap = HTMLdoc.getElementsByClassName("trap")
        Set sp = HTMLdoc.getElementsByClassName("sp")
            For i = 1 To dogname.Length - 1
                If dogname(i).innerText <> "Greyhound" Then
                    Range("'sheet1'!a" & i) = dogname(i).innerText
                    Range("'sheet1'!G" & i) = trap(i).innerText
                    Range("'sheet1'!M" & i) = sp(i).innerText
                End If
            Next
            ie.Quit
End Sub

Thanks for looking, its doing my head in.

Dave

<colgroup><col style="width:68pt" width="90"> <col style="width:32pt" width="42"> <col style="width:57pt" width="76"> <col style="width:30pt" width="40"> <col style="width:37pt" width="49"> <col style="width:39pt" width="52"> <col style="width:95pt" width="126"> <col style="width:98pt" width="131"> <col style="width:95pt" width="126"> <col style="width:93pt" width="124"> <col style="width:96pt" width="128"> <col style="width:89pt" width="118"> <col style="width:36pt" width="48" span="6"> <col style="width:33pt" width="44" span="6"> </colgroup><tbody>
</tbody>
 
Domenic

wow, i mean, WOW, I am nearly speechless. Thankyou so much, it is exactly what i wanted.
You have made that look easy.
I take my hat off, absolutly blown away with this.

Thankyou again, it is literally perfect.

Im so greatful for your time and efforts on this.

If your ever feeling down and need a laugh, just pull up my code LOL.

There are people that know VBA and people that think they know.

I know what one i am and also what one you are.

GREAT JOB MATE

Dave
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Domenic

wow, i mean, WOW, I am nearly speechless. Thankyou so much, it is exactly what i wanted.
You have made that look easy.
I take my hat off, absolutly blown away with this.

Thankyou again, it is literally perfect.

Im so greatful for your time and efforts on this.

If your ever feeling down and need a laugh, just pull up my code LOL.

There are people that know VBA and people that think they know.

I know what one i am and also what one you are.

GREAT JOB MATE

Dave

Think i love this line:
There are people that know VBA and people that think they know.

I know what one i am and also what one you are.
 
Upvote 0
Dave, that is absolutely great to hear. I'm really glad I was able to help. And thank you for you feedback, and your kind words.

Cheers! :)
 
Upvote 0
Hi,
Returning to this great thread,I have used this code and variations therof since it was put up here:)
Trouble is only last week GBGB come up with a new website format(IMHOnot as good or fast as the last one) and it renders this great code a wee bit redundent ):
Anybody out there up for a re-write of the code :) :) :).It's totally beyond me.Here is a full meeting from GBGB
https://www.gbgb.org.uk/meeting/?meetingId=350589
Any suggestions,hints most welcome
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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