# Data extraction from a website with ajax

**URL:** <https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290>\
**Category:** web dev\
**Created:** [June 14, 2008, 2:21am UTC](https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290 "2008-06-14T02:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinchu37](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dinchu37](https://forum.kirupa.com/u/dinchu37)\
**Post date:** [June 14, 2008, 2:21am UTC](https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290/1 "2008-06-14T02:21:44Z")

</div>

Hi, i need to make a web aplication that is able to get the contents from a webpage, the problem is almost the entire website is in ajax and i need to get an specific data and the only way to access there is inserting a javascript command.

The traditional way is to copy the webpage contents but i need to copy them after the ajax loads the info i’m looking for.

Please Help me!

I’m using javascript, php and curl is possible to make something to get that info?

---

<div class="post-metadata">

**Author:** ![dinchu37](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dinchu37](https://forum.kirupa.com/u/dinchu37)\
**Post date:** [June 14, 2008, 3:46am UTC](https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290/2 "2008-06-14T03:46:42Z")

</div>

the website where i’m trying to make this work is [www.betfair.com](http://www.betfair.com)

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [June 14, 2008, 2:05pm UTC](https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290/3 "2008-06-14T14:05:54Z")

</div>

Okay well, I have to admit I’m just throwing thoughts at you. None of these are anything I’ve tried.

(btw don’t multipost :X)

I seem to recall when talking about the ajax class XMLHttpRequest, that it could fetch content that itself is made by ajax? And you can provide u/p and such if needed too.

Also, not sure if this is something that will work cross servers, but I know jQuery has a lot of Ajax support… something like this maybe;

```auto

$.ajax({
  type: "POST",
  url: "http://www.yada.com/page.php/ajaxMethod",
  data: "{}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(msg) {
    // Do something interesting here.
  }
});

```

Other than that, no clue.

---

<div class="post-metadata">

**Author:** ![dinchu37](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dinchu37](https://forum.kirupa.com/u/dinchu37)\
**Post date:** [June 14, 2008, 10:06pm UTC](https://forum.kirupa.com/t/data-extraction-from-a-website-with-ajax/263290/4 "2008-06-14T22:06:52Z")

</div>

Using that code i can apply a javascript function to open the content i need and then use the innerHtmlfrom the div I need?
