-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7709e08
commit 2603c0b
Showing
16 changed files
with
186 additions
and
300 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<ul class="tags"> | ||
<li>a</li> | ||
<li>b</li> | ||
<li>c</li> | ||
</ul> | ||
<ul class="tags"> | ||
<li>d</li> | ||
<li>e</li> | ||
</ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var read = require('fs').readFileSync; | ||
var html = read(__dirname + '/array-of-arrays.html'); | ||
var Xray = require('..'); | ||
var x = Xray() | ||
|
||
x(html, '.tags', [['li']])(function(err, arr) { | ||
console.log(arr); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<body> | ||
<a href="http://google.com">Google</a> | ||
<a href="http://facebook.com">Facebook</a> | ||
<a href="http://twitter.com">Twitter</a> | ||
</body> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var read = require('fs').readFileSync; | ||
var html = read(__dirname + '/arrays.html'); | ||
var Xray = require('..'); | ||
var x = Xray() | ||
|
||
x(html, ['a'])(function(err, arr) { | ||
console.log(arr); | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="items"> | ||
<div class="item"> | ||
<h2>first item</h2> | ||
<ul class="tags"> | ||
<li>a</li> | ||
<li>b</li> | ||
<li>c</li> | ||
</ul> | ||
</div> | ||
<div class="item"> | ||
<h2>second item</h2> | ||
<ul class="tags"> | ||
<li>d</li> | ||
<li>e</li> | ||
</ul> | ||
</div> | ||
</div> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var read = require('fs').readFileSync; | ||
var html = read(__dirname + '/collection-of-collections.html'); | ||
var Xray = require('..'); | ||
var x = Xray() | ||
|
||
x(html, '.item', [{ | ||
title: 'h2', | ||
tags: x('.tags', ['li']) | ||
}])(function(err, arr) { | ||
console.log(arr); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h2 class="title">first item</h2> | ||
<img src="item.png"> | ||
<ul class="tags"> | ||
<li>a</li> | ||
<li>b</li> | ||
<li>c</li> | ||
</ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var read = require('fs').readFileSync | ||
var html = read(__dirname + '/collections.html') | ||
var Xray = require('..') | ||
var x = Xray() | ||
|
||
x(html, { | ||
title: '.title', | ||
image: 'img@src', | ||
tags: ['li'] | ||
})(function(err, obj) { | ||
console.log(obj); | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h2>header two</h2> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var read = require('fs').readFileSync | ||
var html = read(__dirname + '/selector.html') | ||
var Xray = require('..') | ||
var x = Xray() | ||
|
||
x(html, 'h2')(function(err, title) { | ||
console.log(title); | ||
}) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var Xray = require('./'); | ||
var x = Xray(); | ||
|
||
x('http://google.com', { | ||
main: 'title', | ||
image: x('https://images.google.com', 'title') | ||
})(function(err, obj) { | ||
console.log(obj); // => { main: 'Google', image: 'Google Images' } | ||
}) |
This file contains 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