import mql from '@microlink/mql' const { data } = await mql('https://microlink.io', { function: '({ page }) => page.evaluate("jQuery.fn.jquery")', scripts: [ "https://code.jquery.com/jquery-3.5.0.min.js" ] })
function
Type: <string>
It runs JavaScript code with runtime access to a headless browser.
The function will receive any query parameter provided, plus:
html
: The target url HTML markup.page
: Thepuppeteer#pageto interact with the headless browser.response
: Thepuppeteer#responseas result of the implicitpage.goto.
Compression
Since the function body can be large, you can compress it:
You should to prefix the compressed data with the compressor alias.
The following compression algorithms are supported:
- brotli (br)
- gzip (gz)
- lz-string (lz)
Read how to compress to know more.
NPM packages
Require NPM packages on runtime is supported.
The list of allowed NPM packages are:
- @aws-sdk/client-s3
- @mozilla/readability
- cheerio
- extract-email-address
- got
- ioredis
- jsdom
- lodash
- metascraper
- p-reflect
- p-retry
- p-timeout
- path
- url
- youtube-dl-exec
If you want to request a npm package, please feel free to
reach us
.