Created
May 11, 2012 21:58
-
-
Save dukex/2662645 to your computer and use it in GitHub Desktop.
Reactive Scraper Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- http://reactivescraper.herokuapp.com/test.html --> | |
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<ul> | |
<li> | |
<span class="name"> Jonh </span> | |
<span class="votes"> 90 </span> | |
</li> | |
<li> | |
<span class="name"> Marie </span> | |
<span class="votes"> 3 </span> | |
</li> | |
<li> | |
<span class="name"> Paul </span> | |
<span class="votes"> 10 </span> | |
</li> | |
</ul> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("li").each(function(){ | |
document.save({ | |
name: $(this).find(".name").text(), | |
votes: $(this).find(".votes").text() | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment