An introduction to research

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bobbydrake
    SBR Rookie
    • 02-16-09
    • 38

    #211
    Simple Perl Web Parser Script
    I don't mean any disrespect toward the original poster's preferred programming language. This is just another method. We all need options in life.
    ---------------------------------------------------------------
    #! /usr/bin/perl
    print "Content-type: text/html\n\n";

    use LWP::Simple;

    use HTML::TreeBuilder;

    use HTML::FormatText;

    $URL = get("http://www.websiteyouwanttoparse.com");

    $Format = HTML::FormatText->new;

    $TreeBuilder = HTML::TreeBuilder->new;

    $TreeBuilder->parse($URL);

    $Parsed = $Format->format($TreeBuilder);

    print "$Parsed";
    open(FILE, ">file.txt");
    print FILE "$Parsed";
    close(File);

    exit;
    --------------------------------------------------------------
    Things you need to edit:
    $URL = get("http://www.websiteyouwanttoparse.com");
    Change the website name to a website you want to parse. If you know a little perl, those quotations have to be included.

    and also edit
    open(FILE, ">file.txt");
    Change file.txt to a file name of your choice. Remember to change this every time you parse a new website or you'll have this program delete all the info on that file from a previous save.

    This is my opinion. I take no responsibility for your actions. This is only for educational purposes.
    Last edited by bobbydrake; 03-09-12, 04:04 PM. Reason: format
    Comment
    • SBFootball
      Restricted User
      • 02-18-12
      • 12

      #212
      thanks. my friend
      Comment
      • Lovin'life
        SBR Rookie
        • 02-22-12
        • 31

        #213
        For ideas on what you can do with the data search kindergartencapper tournament spreadsheet it is a google spreadsheet a guy made for NCAA great for ideas. I haven't done any of this and this forum caught my attention. I found this spreadsheet and am now serious. I start reading Baseball Hacks today.
        Comment
        • superjeff24
          SBR MVP
          • 03-17-10
          • 1078

          #214
          ok noob question:

          Is this just for doing arbitrage, or would this be something you can use for regular sports betting? What is the advantage of using a spreadsheet? Will it make it easier to keep track of profits/losses? I'm about to start the book, hopefully someone can help a noob out here. THanks
          Comment
          • PokerSource
            SBR Rookie
            • 04-15-12
            • 20

            #215
            Great thread.
            Comment
            • Investapick
              SBR Rookie
              • 06-11-12
              • 7

              #216
              A lot of good info
              Comment
              • lecubs28
                SBR Wise Guy
                • 10-17-11
                • 638

                #217
                thanks for all the useful info in this thread. it is a very good guide for the things i'm trying to learn.

                currently i'm working through the python book recommended by the op. i have no previous coding experience, so it is slow but rewarding. i am having trouble opening a file in python though. here's the syntax of file "chaos.py"

                Code:
                def main ():    print "this program illustrates chaotic function"
                    x = input ("enter number btwn 0 and 1: ")
                    for i in range (10):
                        x = 3.9 * x * (1-x)
                        print x
                it runs just fine

                Code:
                main ()this program illustrates chaotic function
                enter number btwn 0 and 1: .4
                0.936
                0.2336256
                0.698274248196
                0.821680557759
                0.571434313164
                0.955098841721
                0.16725167263
                0.543186347468
                0.96772626363
                0.121805355011
                but when i try to call it from the command line i get issues:

                Code:
                python.chaos.py
                
                Traceback (most recent call last):
                File "<pyshell#0>", line 1, in <module>
                python.chaos.py
                NameError: name 'python' is not defined
                or if i try calling just chaos.py, similar error message:

                Code:
                Traceback (most recent call last):  File "<pyshell#4>", line 1, in <module>
                    chaos.py
                NameError: name 'chaos' is not defined
                what am i doing wrong?
                -----------------------------------------------------------------------
                also my friend recommended i learn python using codeacademy. anybody have anything to say regarding whether codeacademy or the zelle book (the one in the op) is better, or what each is better for?
                Comment
                • CoverOne
                  SBR Rookie
                  • 07-11-12
                  • 42

                  #218
                  So I am completely unfamiliar with coding and programming, but is it actually possible to have a program automatically gather box score data and update daily saved into an excel file? If that's possible and relatively easy to learn, my betting habits may become much easier...
                  Comment
                  • moneylineer
                    SBR Rookie
                    • 09-11-10
                    • 21

                    #219
                    Originally posted by lecubs28
                    thanks for all the useful info in this thread. it is a very good guide for the things i'm trying to learn.

                    currently i'm working through the python book recommended by the op. i have no previous coding experience, so it is slow but rewarding. i am having trouble opening a file in python though. here's the syntax of file "chaos.py"

                    Code:
                    def main ():    print "this program illustrates chaotic function"
                        x = input ("enter number btwn 0 and 1: ")
                        for i in range (10):
                            x = 3.9 * x * (1-x)
                            print x
                    it runs just fine

                    Code:
                    main ()this program illustrates chaotic function
                    enter number btwn 0 and 1: .4
                    0.936
                    0.2336256
                    0.698274248196
                    0.821680557759
                    0.571434313164
                    0.955098841721
                    0.16725167263
                    0.543186347468
                    0.96772626363
                    0.121805355011
                    but when i try to call it from the command line i get issues:

                    Code:
                    python.chaos.py
                    
                    Traceback (most recent call last):
                    File "<pyshell#0>", line 1, in <module>
                    python.chaos.py
                    NameError: name 'python' is not defined
                    or if i try calling just chaos.py, similar error message:

                    Code:
                    Traceback (most recent call last):  File "<pyshell#4>", line 1, in <module>
                        chaos.py
                    NameError: name 'chaos' is not defined
                    what am i doing wrong?
                    -----------------------------------------------------------------------
                    also my friend recommended i learn python using codeacademy. anybody have anything to say regarding whether codeacademy or the zelle book (the one in the op) is better, or what each is better for?


                    Try python chaos.py

                    If that doesn't work, then check your PATH through Environment Variables (through control panel in System, Advanced Settings) and make sure Python is in the PATH: column.

                    Hope this helps.
                    Comment
                    • ljump12
                      SBR High Roller
                      • 12-08-09
                      • 112

                      #220
                      Originally posted by CoverOne
                      So I am completely unfamiliar with coding and programming, but is it actually possible to have a program automatically gather box score data and update daily saved into an excel file? If that's possible and relatively easy to learn, my betting habits may become much easier...
                      It's absolutely possible.
                      Comment
                      • BALISTIK
                        SBR Sharp
                        • 07-16-12
                        • 326

                        #221
                        What if I can't find Python 2.6.* anywhere am I SOL?
                        Comment
                        • CoverOne
                          SBR Rookie
                          • 07-11-12
                          • 42

                          #222
                          Originally posted by ljump12
                          It's absolutely possible.
                          How difficult to learn?
                          Comment
                          • Maverick22
                            SBR Wise Guy
                            • 04-10-10
                            • 807

                            #223
                            Very difficult and labor intensive
                            Comment
                            • CoverOne
                              SBR Rookie
                              • 07-11-12
                              • 42

                              #224
                              Originally posted by Maverick22
                              Very difficult and labor intensive
                              Booo
                              Comment
                              • Maverick22
                                SBR Wise Guy
                                • 04-10-10
                                • 807

                                #225
                                Anything worth having, rarely comes easy. Excel has some data import/web query thing. You may want to look into that.
                                Comment
                                • uva3021
                                  SBR Wise Guy
                                  • 03-01-07
                                  • 537

                                  #226
                                  Originally posted by BALISTIK
                                  What if I can't find Python 2.6.* anywhere am I SOL?
                                  You might have 2.7, if you have neither just download python 2.6
                                  Comment
                                  • BALISTIK
                                    SBR Sharp
                                    • 07-16-12
                                    • 326

                                    #227
                                    Originally posted by uva3021
                                    You might have 2.7, if you have neither just download python 2.6
                                    Thanks for the reply. I did have 2.7 but when i tried to save after editing in IDLE, it wouldnt let me open from my desktop. So I thought I would try to find 2.6. Do you have a link I can get 2.6 from, since that is what the op says to use? thanks again.
                                    Comment
                                    • ljump12
                                      SBR High Roller
                                      • 12-08-09
                                      • 112

                                      #228
                                      Originally posted by BALISTIK
                                      Thanks for the reply. I did have 2.7 but when i tried to save after editing in IDLE, it wouldnt let me open from my desktop. So I thought I would try to find 2.6. Do you have a link I can get 2.6 from, since that is what the op says to use? thanks again.
                                      Just use the most recent 2.x version, it will be fine
                                      Comment
                                      • caveira
                                        SBR Wise Guy
                                        • 08-07-11
                                        • 532

                                        #229
                                        Excelent ljump12! Keep updating for us!
                                        Comment
                                        • zorba74
                                          SBR Hustler
                                          • 07-27-11
                                          • 68

                                          #230
                                          This is a fantastic thread. Why did Jump not go over Part 2? I was looking forward to learning more about the possibilities of using Excel.
                                          Comment
                                          • Inspirited
                                            SBR MVP
                                            • 06-26-10
                                            • 1788

                                            #231
                                            There are now a ton of free courses available.

                                            At udacity you can learn python by taking cs101 and learn basic statistics by taking ST101.



                                            Coursera has a stats class where you'll be using R. They have some introductory programming courses, a couple machine learning courses and a lot of other data analysis type classes coming up in the future. They also have intro to finance and another comp finance course.

                                            Find Courses and Certifications from top universities like Yale, Michigan, Stanford, and leading companies like Google and IBM. Join Coursera for free and transform your career with degrees, certificates, Specializations, &amp; MOOCs in data science, computer science, business, and hundreds of other topics.


                                            EdX has some introductory programming classes and Intro to Artificial Intelligence.

                                            Find the online learning path for you, delivered by world-class institutions like Harvard, Google, Amazon, and more.
                                            Comment
                                            • zorba74
                                              SBR Hustler
                                              • 07-27-11
                                              • 68

                                              #232
                                              Thank you very much Inspirited; your links were very helpful and I already signed up for the basic stat course at Udacity.

                                              I did some poking around on the other links and couldn't find anything relating to Excel. Will these links help me become more conversant in Excel as well?

                                              Thank you again.
                                              Comment
                                              • Inspirited
                                                SBR MVP
                                                • 06-26-10
                                                • 1788

                                                #233
                                                Excel Statistics
                                                http://www.youtube.com/course?list=EC532F30A36E392932
                                                Comment
                                                • zorba74
                                                  SBR Hustler
                                                  • 07-27-11
                                                  • 68

                                                  #234
                                                  Thank you Inspirited.
                                                  Comment
                                                  • MikeJohnson
                                                    SBR Rookie
                                                    • 10-02-12
                                                    • 1

                                                    #235
                                                    Hello guys - great post. I'm new to SBR, but an avid sports enthusiast and bettor (semi-pro I like to think), for to many years now. Wanted to throw a thought into this thread for those seeking to learn the code side to build a model (which I did many many moons ago), take a step back and evaluate how much time and the cost of your time is involved to learn and apply...unless you take it up as a hobby. The approach that evolved over time and works phenominal for me is to define your requirements and outsource to offshore development teams. There are pros/cons to this of course (I learned these the good and bad the hard way), but its a) affordable, b) takes some time to find a quality team/guy, c) leave it to the experts to build your model or your scraping scripts, and d) estimate the offset cost of your time to learn and build, test, mess up, do again, etc. than to leave it to the experts.
                                                    I've evolved my model over the years with this approach for a number of back-burner projects, and my sports modelling.

                                                    My $0.02 for those who get the fear factor with having to learn programming or get wet in this area. Hire a pro...not the sexy kind of pros, but the technical kind...ok, digging a hole here.

                                                    Hope this helps those who seek a different path to get to the same destination.
                                                    Comment
                                                    • omgkyleflavin
                                                      SBR Rookie
                                                      • 10-09-12
                                                      • 3

                                                      #236
                                                      I'm in the process of reading the recommended Python book. I'm wondering if it eventually covers getting your data to appear on an excel spreadsheet? Not sure if anyone else has read it but I'm hoping to have some spreadsheets ready for CBB and I'm worried that getting my data to excel will be the hardest part.
                                                      Comment
                                                      • sayhey69
                                                        SBR Hustler
                                                        • 04-16-12
                                                        • 50

                                                        #237
                                                        write to csv
                                                        Comment
                                                        • tha
                                                          SBR Rookie
                                                          • 12-10-12
                                                          • 9

                                                          #238
                                                          I understand the kind intention of this post but I cannot believe anyone can do it. I also get the 'no pain, no gain' deal behind anything but it seems like just too much for anyone pick up over a few days and use it to their advantage.
                                                          Comment
                                                          • Zombie Woof
                                                            SBR Rookie
                                                            • 09-01-12
                                                            • 26

                                                            #239
                                                            Life...

                                                            Life is good!
                                                            Comment
                                                            • Inspirited
                                                              SBR MVP
                                                              • 06-26-10
                                                              • 1788

                                                              #240
                                                              Originally posted by tha
                                                              I understand the kind intention of this post but I cannot believe anyone can do it. I also get the 'no pain, no gain' deal behind anything but it seems like just too much for anyone pick up over a few days and use it to their advantage.
                                                              it's not gonna happen over a few days. u just have to keep at it.
                                                              Comment
                                                              • Sweettooth
                                                                SBR Rookie
                                                                • 02-22-13
                                                                • 30

                                                                #241
                                                                Should offer apprenticeships for % of your pupils winnings or something.
                                                                Comment
                                                                • Hadley13
                                                                  SBR High Roller
                                                                  • 03-03-13
                                                                  • 125

                                                                  #242
                                                                  Sorry but I'm very new to how these systems work. Do your systems weigh for different variables and spit out a point spread, that you then compare against Vegas' line?
                                                                  Comment
                                                                  • scottgodson1985
                                                                    SBR Sharp
                                                                    • 11-17-12
                                                                    • 347

                                                                    #243
                                                                    thanks man excellent post
                                                                    Comment
                                                                    • mikmak
                                                                      SBR Rookie
                                                                      • 05-03-13
                                                                      • 29

                                                                      #244
                                                                      Wow ... great post. Thanks to whoever stickied this.

                                                                      EDIT: Oh ... and of course ... thank you to lJump12 for the great writeup.
                                                                      Last edited by mikmak; 05-07-13, 12:51 PM.
                                                                      Comment
                                                                      • Inspirited
                                                                        SBR MVP
                                                                        • 06-26-10
                                                                        • 1788

                                                                        #245
                                                                        Would anyone be interested in a basic sports analytics book that is based on R or Python?
                                                                        Comment
                                                                        SBR Contests
                                                                        Collapse
                                                                        Top-Rated US Sportsbooks
                                                                        Collapse
                                                                        Working...