1. #1
    matthew919
    Update your status
    matthew919's Avatar Become A Pro!
    Join Date: 11-21-12
    Posts: 421
    Betpoints: 5869

    A whopping 79 betpoints up for grabs!

    I'm in need of assistance here, and I'm hoping someone can help. I really want to find an "example" script that will help teach me the art of scraping data from mlb.com, preferably using python's BeautifulSoup library. If you can provide a script that can scrape a few stats for all games in a single day, all my betpoints are belong to you.

    So basically, something that scrapes the innings pitched for each starting pitcher, as well as the number of walks and hits allowed for each inning would be fantastic. Well, I actually need a lot more data than that, but the easiest way for me to learn how to do the rest of it myself would be to start with a very simple script that is commented, and continue from there. In return, I'm happy to post my finished script that scrapes all the data I am interested in. Actually, I'm surprised something like this hasn't been posted somewhere in the past.

    Anyone with the expertise feel like sharing?

    Thanks,
    Matt

  2. #2
    Miz
    Miz's Avatar Become A Pro!
    Join Date: 08-30-09
    Posts: 695
    Betpoints: 3162

    If you're lazy like me, you can go to rent-a-coder and get one of those guys to do it for probably $300. Money well spent !

    Then you're the boss and can tell them exactly which parameters you need. Then you get both things accomplished... you learn how to do it and you don't actually have to waste your time banging your head against the wall trying to blaze that trail yourself.
    Points Awarded:

    GP gave Miz 2 SBR Point(s) for this post.


  3. #3
    matthew919
    Update your status
    matthew919's Avatar Become A Pro!
    Join Date: 11-21-12
    Posts: 421
    Betpoints: 5869

    Thanks Miz. But 300 bucks is too rich for my blood, unfortunately. If no one is feeling generous, I'll set aside a Saturday for it at some point.

    Maverick- $300 is your answer I guess...

  4. #4
    bztips
    bztips's Avatar Become A Pro!
    Join Date: 06-03-10
    Posts: 283

    OP, I have exactly what you're looking for -- Python script that scrapes from mlb. I will try to post it later today when I get to my home computer.
    Points Awarded:

    matthew919 gave bztips 1 SBR Point(s) for this post.

    matthew919 gave bztips 1 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.

    matthew919 gave bztips 2 SBR Point(s) for this post.


  5. #5
    matthew919
    Update your status
    matthew919's Avatar Become A Pro!
    Join Date: 11-21-12
    Posts: 421
    Betpoints: 5869

    Yes! Thank you sir!

    I just tried to send you a 25 point advance, but was denied, saying you either could not receive them or I can't send them... any idea why that might be? I'll retry later.

    EDIT: Weird. It just let me give you a total of two points (1 point separately, for two instances), then stopped letting me give you any at all.
    Last edited by matthew919; 01-07-13 at 03:48 PM.

  6. #6
    stikymess
    stikymess's Avatar Become A Pro!
    Join Date: 05-19-10
    Posts: 3,288
    Betpoints: 63

    Quote Originally Posted by matthew919 View Post
    Yes! Thank you sir!

    I just tried to send you a 25 point advance, but was denied, saying you either could not receive them or I can't send them... any idea why that might be? I'll retry later.
    You have to be an SBR Pro to send points, non-pro can send a max of 2 per day.

  7. #7
    matthew919
    Update your status
    matthew919's Avatar Become A Pro!
    Join Date: 11-21-12
    Posts: 421
    Betpoints: 5869

    Well then, I guess I'll sign up for the installment plan. Don't worry bz; I'm good for it. Stellar credit score right here.

  8. #8
    ProPicker713
    METS!
    ProPicker713's Avatar Become A Pro!
    Join Date: 12-15-10
    Posts: 6,788
    Betpoints: 17

    go to the baseballpress and dailybaseballdata they have some great statisical info.

  9. #9
    bztips
    bztips's Avatar Become A Pro!
    Join Date: 06-03-10
    Posts: 283

    python stuff

    OK, here's my python script and supporting files to scrape starting lineups (using MLB player codes) from all games on a given day. Obviously you could enhance it to scrape other data from the boxscores.

    Normally I would reference "yesterday" relative to today's actual date, but I've hard-coded a specific date so you can test it out and see that it works.

    I'm sure there are more efficient ways to do the Python coding, but I've taught myself just enough to get by.

    Don't worry about the points; I don't really need them.

    Good luck with your scraping!
    Attached Files

  10. #10
    matthew919
    Update your status
    matthew919's Avatar Become A Pro!
    Join Date: 11-21-12
    Posts: 421
    Betpoints: 5869

    Thanks a million; this is great! I'm going to post my R script that parses play by play and game log data from Retrosheet- if you have any interest in that sort of thing. (Might be a few days til I can get it together though...)

Top