Well Well Well, Anthra you are a clever person, Are
nt you
I nearly fell over when i read your post.
Would it help if we used another web site to gather data
As you stated the tables are not all that well structured.
well I will give thisone a go first and if there is anything I can do for
you just ask and I will try my best.
I really appreciate what you have done.
Of course I will try to follow your code to see if any will fall on
meLOL
Regards
Graham
"Anthra Norell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> - Original Message -
> From: "Graham Feeley" <[EMAIL PROTECTED]>
> Newsgroups: comp.lang.python
> To:
> Sent: Friday, July 28, 2006 5:11 PM
> Subject: Re: Newbie..Needs Help
>
>
>> Thanks Nick for the reply
>> Of course my first post was a general posting to see if someone would be
>> able to help
>> here is the website which holds the data I require
>> http://www.aapracingandsports.com.au/racing/raceresultsonly.asp?storydate=27/07/2006&meetings=bdgo
>>
>> The fields required are as follows
>> NSW Tab
>> # Win Place
>> 2$4.60 $2.40
>> 5$2.70
>> 1$1.30
>> Quin$23.00
>> Tri $120.70
>> Field names are
>> Date ( not important )
>> Track= Bendigo
>> RaceNoon web page
>> Res1st...2
>> Res2nd..5
>> Res3rd..1
>> Div1..$4.60
>> DivPlc...$2.40
>> Div2..$2.70
>> Div3..$1.30
>> DivQuin.$23.00
>> DivTrif...$120.70
>> As you can see there are a total of 6 meetings involved and I would need
>> to
>> put in this parameter ( =bdgo) or (=gosf) these are the meeting tracks
>>
>> Hope this more enlightening
>> Regards
>> graham
>>
>
> Graham,
>
> Only a few days ago I gave someone a push who had a very similar problem.
> I handed him code ready to run. I am doing it again for
> you.
> The site you use is much harder to interpret than the other one was
> and so I took the opportunity to experimentally stretch
> the envelope of a new brain child of mine: a stream editor called SE. It
> is new and so I also take the opportunity to demo it.
> One correspondent in the previous exchange was Paul McGuire, the
> author of 'pyparse'. He made a good case for using 'pyparse'
> in situations like yours. Unlike a stream editor, a parser reads structure
> in addition to data and can relate the data to its
> context.
> Anlayzing the tables I noticed that they are poorly structured: The
> first column contains both data and ids. Some records are
> shorter than others, so column ids have to be guessed and hard coded.
> Missing data sometimes is a dash, sometimes nothing. The
> inconsistencies seem to be consistent, though, down the eight tables of
> the page. So they can be formalized with some confidence
> that they are systematic. If Paul could spend some time on this, I'd be
> much interested to see how he would handle the relative
> disorder.
> Another thought: The time one invests in developing a program should
> not exceed the time it can save overall (not talking
> about recreational programming). Web pages justify an extra measure of
> caution, because they may change any time and when they do
> they impose an unscheduled priority every time the reader stops working
> and requires a revision.
>
> So, here is your program. I write it so you can copy the whole thing to a
> file. Next copy SE from the Cheese Shop. Unzip it and put
> both SE.PY and SEL.PY where your Python progams are. Then 'execfile' the
> code in an IDLE window, call 'display_horse_race_data
> ('Bendigo', '27/07/2006') and see what happens. You'll have to wait ten
> seconds or so.
>
> Regards
>
> Frederic
>
> ##
>
> TRACKS = { 'New Zealand' : '',
> 'Bendigo' : 'bdgo',
> 'Gosford' : 'gosf',
> 'Northam' : 'nthm',
> 'Port Augusta': 'pta',
> 'Townsville' : 'town',
> }
>
>
> # This function does it all once all functions are loaded. If nothing
> shows, the
> # page has not data.
>
> def display_horse_race_data (track, date, clip_summary = 100):
>
> """
> tracks: e.g. 'Be