Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Improve getRandomUserAgent() docs
Ondra Urbanfb90a2561df9
diff --git a/src/utils.js b/src/utils.jsindex 486424859..b2239797f 100644--- a/src/utils.js+++ b/src/utils.js@@ -378,6 +378,8 @@ const extractUrls = ({ string, urlRegExp = URL_NO_COMMAS_REGEX }) => {/*** Returns a randomly selected User-Agent header out of a list of the most common headers.+ * @returns {String}+ * @memberOf utils*/const getRandomUserAgent = () => {const index = getRandomInt(USER_AGENT_LIST.length);