
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Get the HTML from any website, fine-tuned for correction & speed.
html-get takes advantage of puppeteer headless technology when is needed, such as client-side apps that needs to be prerender.
$ npm install browserless puppeteer html-get --save
const createBrowserless = require('browserless')
const getHTML = require('html-get')
// Spawn Chromium process once
const browserlessFactory = createBrowserless()
// Kill the process when Node.js exit
process.on('exit', () => {
console.log('closing resources!')
browserlessFactory.close()
})
const getContent = async url => {
// create a browser context inside Chromium process
const browserContext = browserlessFactory.createContext()
const getBrowserless = () => browserContext
const result = await getHTML(url, { getBrowserless })
// close the browser context after it's used
await getBrowserless((browser) => browser.destroyContext())
return result
}
getContent('https://example.com')
.then(content => {
console.log(content)
process.exit()
})
.catch(error => {
console.error(error)
process.exit(1)
})
$ npx html-get https://example.com
Required
Type: string
The target URL for getting the HTML markup.
Type: string
Default: 'utf-8'
It ensures the HTML markup is encoded to the encoded value provided.
The value will be passes to html-encode
Required
Type: function
A function that should return a browserless instance to be used for interact with puppeteer:
Type: function
It determines the strategy to use based on the url, being the possibles values 'fetch' or 'prerender' .
Type: function
It creates a temporal file.
Type: object
It passes configuration object to got under 'fetch' strategy.
Type: object
Request headers that will be passed to fetch/prerender process.
Type: function|boolean
Default: source code
It returns a function that receives that executes mutool binary for turning PDF files into HTML markup.
It can explicitly disabled passing false.
Type: boolean|string
Default: 'auto'
Enable or disable prerendering as mechanism for getting the HTML markup explicitly.
The value auto means that that internally use a list of websites that don't need to use prerendering by default. This list is used for speedup the process, using fetch mode for these websites.
See getMode parameter for know more.
Type: object
It passes coniguration object to puppeteer under 'prerender' strategy.
Type: boolean
Default: false
When is true, it will be rewritten CSS/HTML relatives URLs present in the HTML markup into absolutes.
Type: boolean
Default: false
When is true, it will rewrite some common mistake related with HTML meta tags.
It determines how HTML should be serialied before returning.
It's serialized $ => ({ html: $.html() }) by default.
html-get © Microlink, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
microlink.io · GitHub microlinkhq · X @microlinkhq
FAQs
Get the HTML from any website, fine-tuned for correction & speed
The npm package html-get receives a total of 1,489 weekly downloads. As such, html-get popularity was classified as popular.
We found that html-get demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.