Auto extract data from other website html table

Discussion in 'PHP' started by choyj, Jul 10, 2014.

  1. #1
    I want to create a PHP or HTML/JavaScript page (I believe PHP is the best choice), that allows me to automatically extract other website html table data.

    For example I want to know the earnings of a racehorse.
    In my page, I will have a column that requires me to type in the name of the racehorse (lets say Mossfun).

    The website racenet.com.au can generate an unique link for each horse, in this case for Mossfun, it will be racenet.com.au/horse/mossfun

    The data I wanna extract is the Career Earnings, in the racenet.com.au/horse/mossfun, I know this data is under the table with a class name: HorseFeatTable

    so when I type in Mossfun in the table, the next column will help me gather the earnings data from racenet.com.au

    Is this possible?

    Thanks
     
    choyj, Jul 10, 2014 IP
  2. pentaxial

    pentaxial Active Member

    Messages:
    101
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    78
    #2
    Hi,
    Yes its possible,

    Gather data's from other website ( scrapping ) - can be done using PHP easily.

    Based on the details you need, There is 2 ways for your need:

    1. If data varies more time for a day , Everytime you search a name and it get scrape instantly from other website and get results

    - This way have a bit complication, loading time will be high, and we are accesing other website page more times for a day without permission (if we do)

    2. Setting the scrapper one time per day ( if data will get change only one time in other website)
    then you can do your operations at any time like just a local operation in php

    If any needs, just post here :)

    Thanks
     
    pentaxial, Jul 10, 2014 IP
  3. choyj

    choyj Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks!

    Just wonder can I request sample code in this forum?
    thanks,
     
    choyj, Jul 10, 2014 IP
  4. pentaxial

    pentaxial Active Member

    Messages:
    101
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    78
    #4
    Hi ,

    Thanks for your reply,

    its not a constant code, based on the Other site ( the site which you are going to scrape the details) HTML ( view source), it may get differ on our php code

    thanks
     
    pentaxial, Jul 10, 2014 IP
  5. choyj

    choyj Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Hi, thanks for helping me out.

    I understand it depends on the site, just wonder what's the approach as I am not very familiar with PHP.

    Are you able to show me the sample code of my example above (mossfun x racenet)

    Thanks! Appreciate very much.

     
    choyj, Jul 10, 2014 IP