Created
July 15, 2020 04:30
-
-
Save tmcw/a80e4b45b3d7b3cc1c6fce46b5a4aa95 to your computer and use it in GitHub Desktop.
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
const got = require("got"); | |
const selectAll = require("hast-util-select").selectAll; | |
const unified = require("unified"); | |
const parse = require("rehype-parse"); | |
(async function () { | |
const { body } = await got("https://macwright.com/"); | |
const ast = await unified() | |
.use(parse, { emitParseErrors: true, duplicateAttribute: false }) | |
.parse(body); | |
console.log(selectAll("a", ast)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment