0

Is there any way of taking the table with match-history from this page (http://www.esl.eu/eu/bf3/squadrush/4on4/ladder/team/matches/7492332/) and frame/embed/include it in another site? It's for my team's website and I think tracking these matches without linking to the ESL-site would be awesome.

Dave
  • 285
  • 4
  • 6
  • 16
  • 3
    Unless they provide an API you'd have to scrape the page using a server-side script. It wouldn't be too difficult but it would be prone to breakage if they change the layout of the site. – nullability May 14 '13 at 18:14

2 Answers2

2

If the website has enabled CORS, sure! this is, however, doubtful. If the website has an API, you might be able to parse the information through JavaScript. If not, you're stuck with the good old-fashioned scraping ways!

I wrote an extensive answer with a detailed example for someone wanting to do the same thing: https://stackoverflow.com/a/16144603/2167834 . Hopefully this will provide a solid example of what to do. Note that it requires a server-side processing language.

Community
  • 1
  • 1
Sébastien Renauld
  • 19,203
  • 2
  • 46
  • 66
  • yep ... with the ajax call I did not really think this through with cors, but it is an alternative. Good job with the other answer (+1 from me when my daily vote quota resets ;-) – Martin Turjak May 14 '13 at 18:53
1

1) You can do it with something like php / cURL serverside.

2) Or for instant update, you could do it live with jQuery .ajax() you can call the page and extract the table and put it into the current pages DOM.

        $.ajax({
            url: 'some-page.html',
            dataType: 'html',
            success: function (result) {
               content = $(result).find("selector_of_element_you_want").html();
               $(".result").html(content);
            },
            error: function (result) {
               $(".result").html("err");
            }
        });
Martin Turjak
  • 20,896
  • 5
  • 56
  • 76