
Sadly, however, these pages are not generated by the server. Instead, some sort of AJAX query is used to generate them in the browser. Unfortunately, the code that underpins ESPN's site is as ugly as the site itself. Looking at the source reveals piles of indecipherable JavaScript to generate the tables. This is a problem because any automated method of fetching a box score won't be able to parse the JavaScript. Thus, none of the important data will ever load.
And that's pretty much where I gave up. I know I can have my script open the page in a GUI web browser, then save the resulting static page back out and have the script continue working, but that amount of interactivity is too much. I really wanted the script to handle this for me, running the stats once a day and generating the report I want. I will work on this more eventually, but for now I just don't want to have to deal with all of these terrible web issues. Unless someone else has a suggestion for parsing the JavaScript, I'll leave this alone for a few days.
No comments:
Post a Comment