Scraping data from Oddsportal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • strixee
    SBR Sharp
    • 05-31-10
    • 432

    #1
    Scraping data from Oddsportal
    I'd like to scrape some odds from Oddsportal, but the data is stored in some XML database or what.
    The Javascript code that manipulates it has to be this 0.5 MB monster
    Code:
    http://www.oddsportal.com/res/x/proto-1108031134.js
    I don't think it's easy to acces the database directly, but at least gather the data using AJAX requests. Ha anyone worked with OP? Or do you have any advice how to research it? Should I start from functions such as
    Code:
    XMLHttpRequest, Ajax.Request
    ?
  • uva3021
    SBR Wise Guy
    • 03-01-07
    • 537

    #2
    screen scrape it, send an XML request to the web address and you'll get a response that you can then navigate the html file by accessing the properties
    Comment
    • strixee
      SBR Sharp
      • 05-31-10
      • 432

      #3
      You mean using cURL or some already made application for the screen scraping?
      Comment
      • uva3021
        SBR Wise Guy
        • 03-01-07
        • 537

        #4
        in vb

        Set XMLHttpRequest = New MSXML2.XMLHTTP
        XMLHttpRequest.Open "GET", URL, False
        XMLHttpRequest.send

        Set HTMLDoc = New HTMLDocument
        HTMLDoc.body.innerHTML = XMLHttpRequest.responseText
        Comment
        • uva3021
          SBR Wise Guy
          • 03-01-07
          • 537

          #5
          treat the HTML like an XML request
          Comment
          • vyomguy
            SBR Hall of Famer
            • 12-08-09
            • 5794

            #6
            try curl.
            Comment
            • Pot luck
              SBR Rookie
              • 05-05-11
              • 40

              #7
              In php

              Get the HTML as a string using curl:
              PHP Code:
              $url = "www.google.com";
              $ch = curl_init(); // create curl resource
              curl_setopt($ch, CURLOPT_URL, $url); // set url 
              curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //return the transfer as a string 
              curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2); // sets timeout to 2 seconds
              $output = curl_exec($ch); 
              curl_close($ch); // close curl resource to free up system resources 
              
              Parse into a DOM object:
              PHP Code:
              $doc = new domDocument;
              $doc->loadHTML($output); 
              
              Last edited by Pot luck; 08-16-11, 08:27 PM.
              Comment
              • strixee
                SBR Sharp
                • 05-31-10
                • 432

                #8
                Pot luck, this simple method works for non AJAX websites only.
                Comment
                • Pot luck
                  SBR Rookie
                  • 05-05-11
                  • 40

                  #9
                  Yeah true. I am scraping from the non-AJAX bit of oddsportal (eg http://www.oddsportal.com/matches/). What do you want to get from there? I emailed them a while back and asked how I could get this AJAX-fetched data but got a response along the lines of "huh, do what I dunno?".

                  Interested to see if you get further with this.
                  Comment
                  • strixee
                    SBR Sharp
                    • 05-31-10
                    • 432

                    #10
                    I want to get current odds of a few bookies, mainly SBO, 188 and Pinnacle.
                    The only easy thing is switching between the markets. For example for O/U 1st half you just need to add #over-under;3 to the URL.
                    Comment
                    • Pot luck
                      SBR Rookie
                      • 05-05-11
                      • 40

                      #11
                      Maybe hiring a freelancer would be the way to go.
                      Comment
                      SBR Contests
                      Collapse
                      Top-Rated US Sportsbooks
                      Collapse
                      Working...