How to scrape oddsportal?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gui_m_p
    SBR High Roller
    • 09-18-13
    • 123

    #1
    How to scrape oddsportal?
    I've got the basics of programming in R, and would like to scrape the odds from this page:

    Follow every Football match today - fixtures, results, live scores and odds. Keep track of every Football Matches Today with Odds Portal.


    However, apparently the content (odds) is not in HTML or XML language, so the XML/RCurl packages are not working.

    What is the best approach? Is to possible to do it within R, or I have to go to other language?

    Thanks!
  • TheDonger
    SBR Sharp
    • 11-16-13
    • 352

    #2
    Originally posted by gui_m_p
    I've got the basics of programming in R, and would like to scrape the odds from this page:

    Follow every Football match today - fixtures, results, live scores and odds. Keep track of every Football Matches Today with Odds Portal.


    However, apparently the content (odds) is not in HTML or XML language, so the XML/RCurl packages are not working.

    What is the best approach? Is to possible to do it within R, or I have to go to other language?

    Thanks!
    What do you mean "not in HTML"? Anytime you see content on the web it's HTML unless it's a java app. I've double check and the page that you show me is in HTML. If you download google chrome and press CTRL + J you can use the toolbar to navigate with clean code.

    In my personal opinion, I beleive that PHP is great to scrap HTML code. You can read content easily and search effectively threw a string. You then connect that to a MySQL DB. Once that's done you have pretty much all the data you need with simple queries. GL.
    Comment
    • thom321
      SBR High Roller
      • 06-17-11
      • 112

      #3
      I am not familiar with R but I typically download the Web page source code as a string and then create my own parsing code depending on what data I would like to extract. A lot of sites make it hard since the URL the data is actually coming from is not the URL displayed on the address bar.
      Last edited by thom321; 05-12-14, 01:46 PM.
      Comment
      • lamichaeljames
        SBR Rookie
        • 06-02-14
        • 40

        #4
        Originally posted by gui_m_p
        I've got the basics of programming in R, and would like to scrape the odds from this page:

        Follow every Football match today - fixtures, results, live scores and odds. Keep track of every Football Matches Today with Odds Portal.


        However, apparently the content (odds) is not in HTML or XML language, so the XML/RCurl packages are not working.

        What is the best approach? Is to possible to do it within R, or I have to go to other language?

        Thanks!
        Did you figure this out?
        Comment
        • Omaga
          SBR Sharp
          • 07-10-12
          • 460

          #5
          Here is an iMacros I made for you.

          1) Download iMacros for FF or IE
          2) Copy text in notepad and then save with .iim extension
          3) take the .iim file and place in your iMacros folder and run
          4) Your output file is .csv in your iMacros/downloads as oddsportal.csv

          take the simlly faces and replace with : o but be sure to leave out space in between : o make them join. That is the letter o and NOT zero.

          VERSION BUILD=8032216
          TAB T=1
          SET !ERRORIGNORE YES
          SET !REPLAYSPEED FAST
          SET !TIMEOUT_STEP 1
          SET !TIMEOUT_PAGE 30
          SET !LOOP 1
          'Increase the current position in the file with each loop
          SET !DATASOURCE_LINE {{!LOOP}}
          SET !EXTRACT_TEST_POPUP NO
          URL GOTO=http://www.oddsportal.com/matches/soccer/
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASS:name<SP>table-participant EXTRACT=TXT
          SET !VAR0 {{!EXTRACT}}
          SET !EXTRACT NULL
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASS:center<SP>bold<SP>table-odds<SP>table-score EXTRACT=TXT
          SET !VAR1 {{!EXTRACT}}
          SET !EXTRACT NULL
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASSdds-nowrp EXTRACT=TXT
          SET !VAR2 {{!EXTRACT}}
          SET !EXTRACT NULL
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASSdds-nowrp EXTRACT=TXT
          SET !VAR3 {{!EXTRACT}}
          SET !EXTRACT NULL
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASSdds-nowrp<SP>result-ok<SP>in-coupon EXTRACT=TXT
          SET !VAR4 {{!EXTRACT}}
          SET !EXTRACT NULL
          TAG POS={{!LOOP}} TYPE=TD ATTR=CLASS:center<SP>info-value EXTRACT=TXT
          SET !VAR5 {{!EXTRACT}}
          SET !EXTRACT NULL

          SET !EXTRACT NULL
          ADD !EXTRACT {{!VAR0}}
          ADD !EXTRACT {{!VAR1}}
          ADD !EXTRACT {{!VAR2}}
          ADD !EXTRACT {{!VAR3}}
          ADD !EXTRACT {{!VAR4}}
          ADD !EXTRACT {{!VAR5}}
          SAVEAS TYPE=EXTRACT FOLDER=* FILE=oddsportal.csv
          SET !EXTRACT NULL
          Last edited by Omaga; 06-03-14, 04:46 PM.
          Comment
          • lamichaeljames
            SBR Rookie
            • 06-02-14
            • 40

            #6
            thanks!
            Comment
            SBR Contests
            Collapse
            Top-Rated US Sportsbooks
            Collapse
            Working...