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
fix: improve guessing of chrome executable path on windows (#1294)
audi Bookning82abcdf576dc
diff --git a/src/utils.js b/src/utils.jsindex e32352716..9d859476c 100644--- a/src/utils.js+++ b/src/utils.js@@ -353,9 +353,29 @@ export const getFirstKey = (dict) => {* @ignore*/export const getTypicalChromeExecutablePath = () => {+ /**+ * Return path of Chrome executable by its OS environment variable to deal with non-english language OS.+ * Taking also in account the old [chrome 380177 issue](https://bugs.chromium.org/p/chromium/issues/detail?id=380177).+ *+ * @returns {string}+ * @ignore+ */+ const getWin32Path = () => {+ let chromeExecutablePath = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';+ const path00 = `${process.env.ProgramFiles}\\Google\\Chrome\\Application\\chrome.exe`;+ const path86 = `${process.env['ProgramFiles(x86)']}\\Google\\Chrome\\Application\\chrome.exe`;++ if (fs.existsSync(path00)) {+ chromeExecutablePath = path00;+ } else if (fs.existsSync(path86)) {+ chromeExecutablePath = path86;+ }+ return chromeExecutablePath;+ };+switch (os.platform()) {case 'darwin': return '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';- case 'win32': return 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';+ case 'win32': return getWin32Path();default: return '/usr/bin/google-chrome';}};