#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0

    Parsing problems w. extracting the needed information


    Hi,

    I am trying to write my first webbot/parser and I am stuck right now, so I hope you can help me.

    The website I am looking to parse is racingpost.com, more specific single racecards like this one:

    https://www.racingpost.com/racecards...7-06-13/676415

    I get every information I want, except the Odds for every runner (displayed on the right). If I parse the html site, I get sth. like this:

    <a href="#"
    class="ui-btn
    RC-runnerPrice
    ui-priceBtn_noPrice
    js-diffusionPriceValue
    js-betHandler
    js-runnerPrice
    js-runnerPriceBestOdds"
    data-test-selector="RC-cardPage-runnerPrice">
    </a>
    </div>

    If I inspect the different element in Chrome, I get the information I want, but only for a single runner at a time(!):

    <a href="#" class="ui-btn
    RC-runnerPrice
    js-diffusionPriceValue
    js-betHandler
    js-runnerPrice
    js-runnerPriceBestOdds ui-priceBtn_williamHill" data-test-selector="RC-cardPage-runnerPrice"
    data-diffusion-outcomers-id="1592179340"
    data-diffusion-fractional="3/1"
    data-diffusion-decimal="4.0000"
    data-diffusion-history="3.5000"
    data-diffusion-status="O"
    data-diffusion-event-id="11243011"
    data-diffusion-meeting-id="~"
    data-diffusion-next-price="3/1"
    data-popup-width=""
    data-popup-height="">
    3/1
    </a>

    Is there a way to parse (http_get) the website and extract the odds of the runners?
    Not sure if a form handler helps me here, and as I am fairly new to this, I am stuck
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,350
    Rep Power
    630
    I think you are in the wrong forum. You did not post any server side PHP code so I'm guessing you are trying to do this on the client side using Javascript or js.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0
    *sigh* Bingo, clientside. So, is there a subforum I did miss or generally whrong people to ask?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,350
    Rep Power
    630
    Yes, you want the Javascript forum. You can ask a mod to move this thread.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,436
    Rep Power
    9645
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,350
    Rep Power
    630
    Have you looked at this?

    Comments on this post

    • Krellshand agrees
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0
    Hey, thanks for moving and thanks for the link.

    Will try and come back at you

IMN logo majestic logo threadwatch logo seochat tools logo