1 | # CSS Querying Sax Parser
|
2 |
|
3 | For HTML/XML.
|
4 |
|
5 | ```
|
6 | var cssax = require('../cssax');
|
7 |
|
8 | var stream = cssax.createStream();
|
9 | stream.query('title').on('match', function (tag, attributes) {
|
10 | this.readText(function (text) {
|
11 | console.log(JSON.stringify(text));
|
12 | });
|
13 | });
|
14 |
|
15 | require('fs').createReadStream('file.html').pipe(stream);
|
16 | ```
|