Re: VBA Code To Grab Multiple HTML Tables From Web Page
I didn't realise, the copy/paste I did was wrong. As I pasted into here it added http://%20etc.%20</p%3E%3Cp%3E%3C…0ZV0=%22%20/%3E
Quote& opt.Value
Re: VBA Code To Grab Multiple HTML Tables From Web Page
I didn't realise, the copy/paste I did was wrong. As I pasted into here it added http://%20etc.%20</p%3E%3Cp%3E%3C…0ZV0=%22%20/%3E
Quote& opt.Value
Re: VBA Code To Grab Multiple HTML Tables From Web Page
sorry paul you've lost me, maybe easier if you have a look, the code in "GetLinks" macro can have the date edited for different cards and its the "GetDataFromLink" thats crashing, i've attached it for you to have a look and see what you think. again sincerely appreciate you help as out my depth a bit.forum.ozgrid.com/index.php?attachment/50174/forum.ozgrid.com/index.php?attachment/50174/
Re: VBA Code To Grab Multiple HTML Tables From Web Page
The code you have is to get "past" racecards, what you wanted was to get todays cards, no?
Re: VBA Code To Grab Multiple HTML Tables From Web Page
Quote from snb;640590
In respect of this SNB, this would only give you one race. The coding that Kyle provided gave me the ability to grab every race for a day. Bare in mind that every day the http address changes for each and every race
Re: VBA Code To Grab Multiple HTML Tables From Web Page
hi paul
i want past racecards to work
the GETLINK works but not the data extraction macro
cheers and sorry for any confusion
Re: VBA Code To Grab Multiple HTML Tables From Web Page
I'm no expert, Kyle would have to help but I think it may be because your "Function" was not in the same module as the grabbing code.
I have re-attached your file, with the macros that I use. forum.ozgrid.com/index.php?attachment/50175/
These have been that successful I have downloaded racecards from the past 6 years. If anything download the copy that Kyle provided, that is what I used in the first instance.
Re: VBA Code To Grab Multiple HTML Tables From Web Page
hi, strangly i downloaded it (v2) and it will get the links but not the data?? but the good news is i have made progress (by luck as well as judgement)
after reading back through the posts again it was suggested to change "table" to "racecard". i changed the code back to table and it worked !!! , a bit to well in all honesty grabbing too much data, but its progress so hurrah. many many thanks for your help and if kyle looks in i'd appreciate his input.
basically knowing how to change the macro to get different parts of the racecard page and or how to identify the "elementid. best wishes to everyone and their assistance.
Re: VBA Code To Grab Multiple HTML Tables From Web Page
Sub tst()
On Error Resume Next
For Each hl In Workbooks.Open("http://www.sportinglife.com/racing/results/15-12-2012").Sheets(1).Hyperlinks
If hl.TextToDisplay = "result" Then c01 = c01 & vbCr & hl.Address
Next
sn = Split(Mid(c01, 2), vbCr)
For j = 0 To UBound(sn)
Workbooks.Open "http://www.sportinglife.com/racing/results/" & sn(j)
Next
End Sub
Display More
Re: VBA Code To Grab Multiple HTML Tables From Web Page
hi, thanks for the extra code i can work through that a bit to try and give me some insight, but as i said earlier, i have got it working now. i have got one anomoly which may need web guru help. i would prefer the data from the racecard link rather than the result page. eg this is one link to a results page which can be extracted by macro,
http://www.sportinglife.com/racing/results…vices-39-hurdle
the racecard link is as below by clicking on the racecard tab
http://www.sportinglife.com/racing/racecar…vices-39-hurdle
i thought it would be simple and just change in the url "results to racecards" and "result to racecard" however it extracts the results data rather than the racecard data??
on saving the actual url from sporting life directly as a link to the racecard, click on this link does not take back to the racecard but to the result page where you then click on the Racecard tab?
Any gurus who can fix this will be most impressive, if anyone needs the worksheet with macro loaded up to examine, please ask as i don't want to burden the forum unnecessarily.
cheers and merry xmas
Re: VBA Code To Grab Multiple HTML Tables From Web Page
has anyone had any luck getting the results, i keep getting an error here "ReDim data(1 To table.Rows.Length + 6, 1 To 10)"
Re: VBA Code To Grab Multiple HTML Tables From Web Page
Hi qaz... Welcome to the forum. Maybe start a new thread, and refernece this one if you have to... This one is quite old at this stage. Many thanks.
Ger
Don’t have an account yet? Register yourself now and be a part of our community!