Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Scrape Web Pages with jQuery
JavaScript ActionScript
branch: master
Failed to load latest commit information.
app first commit
.gitignore first commit
jquery.scraper.js readme
parser.js first commit
scraper.swf first commit
swfobject.js first commit


jQuery Scraper

Simple, Cross-Domain Web Scraping with jQuery


$.scrape("", function(document) {

or more explicitly:

  url: "",
  success: function(document) {


you can specify json to get the objects out in a hash of tags:

  url: "",
  format: "json", // or "string"
  success: function(data) {
    // data["link"] = [{href:""}]
    // data["meta"] = [{content:"hello world", name:"description"}]
    // ...


  • Because you can't grab web pages from javascript using javascript. You have to go through either a server side script, or flash. This uses Flash.
  • Server side processing of webpages takes up a lot of resources. Pass that off to the client.


  • It should probably use XPath somehow, like Nokogiri, but it doesn't appear that there's anything like that for Javascript or Actionscript.
  • Maybe it would be helpful to be able to use jQuery on the response (haven't figured that out yet).

Here's an example:

$.scrape("", function(doc) {
  var head = $(doc).find("head"); // doesn't work
  var body = $(doc).find("body"); // doesn't work
  // ...
Something went wrong with that request. Please try again.