user-request
Simulate a user requesting an HTML page
Perfect for web scraping, and allows retry attempts.
You're able to bypass CloudFlare protection by using user-request
.
Install
npm i user-request
Import
const get =
Or...
Instructions
get
function with a URL to fetch that page.
Call the const response = await
get
function
Pass options to the const response = await
Response
object
Properties on the data
: The page's HTML content.headers
: The response headers.status
: The status code.statusText
: The status text.retryAttempts
: The number of retry attempts this request took.didFail
: If the request failed by either returning a 404 or 500, or running out of retry attempts.