Web Scape

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,126
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[TABLE="width: 1654"]
<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>[TR]
[TD="width: 42"][/TD]
[TD="width: 76"][/TD]
[TD="width: 40"][/TD]
[TD="width: 49"][/TD]
[TD="width: 52"][/TD]
[TD="width: 126"][/TD]
[TD="width: 131"][/TD]
[TD="width: 126"][/TD]
[TD="width: 124"][/TD]
[TD="width: 128"][/TD]
[TD="width: 118"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 48"][/TD]
[TD="width: 44"][/TD]
[TD="width: 44"][/TD]
[TD="width: 44"][/TD]
[TD="width: 44"][/TD]
[TD="width: 44"][/TD]
[TD="width: 44"][/TD]
[/TR]
</tbody>[/TABLE]
 
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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,223,691
Messages
6,173,851
Members
452,535
Latest member
berdex

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