-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't run on macs with M1 processors #686
Comments
@kazazor Hi, we already support it. You can use the https://www.npmjs.com/package/israeli-bank-scrapers-core Does it helps? |
Awesome, I'll give it a try |
@esakal maybe I'm missing something here.
import { getPuppeteerConfig } from 'israeli-bank-scrapers-core';
const chromiumVersion = getPuppeteerConfig().chromiumRevision;
I did just that here: const options: ScaperOptions = {
companyId: source,
startDate,
combineInstallments: false,
showBrowser: false,
executablePath: await getChromiumExecutablePath(), // Requires in order to support also ARM based CPUs (like Apple's M1 CPUs)
};
const scraper = createScraper(options); And here is the async function getChromiumExecutablePath(): Promise<string> {
const browserFetcher = puppeteer.createBrowserFetcher();
const chromiumRevision = getPuppeteerConfig().chromiumRevision;
let revisionInfo;
if ((await browserFetcher.localRevisions()).includes(chromiumRevision)) {
revisionInfo = browserFetcher.revisionInfo(chromiumRevision);
} else {
revisionInfo = await browserFetcher.download(chromiumRevision, (downloadBytes: number, totalBytes: number) =>
console.log(`Downloading Chromium: ${downloadBytes}/${totalBytes} (${Math.round((downloadBytes / totalBytes) * 100)}%)`)
);
}
return revisionInfo.executablePath;
} I'm using The problem here is that for M1 CPUs (arm64) I'm getting: What am I missing here? |
when do you get this message, whwen trying to download? when executing scrape? |
During the download. I found this thread online: https://stackoverflow.com/a/66044814 Which points to this fix here: puppeteer/puppeteer@9a8479a In this release (6.0.0) : https://github.com/puppeteer/puppeteer/releases/tag/v6.0.0
Seems to me like updating Another indication this is the case is this issue: puppeteer/puppeteer#6614 Seems like Looking at the breaking changes of version |
By the way, also updating up until version
Even more, looking at the breaking changes all the way to the latest version |
@kazazor thank you for suggestion this fix. I ended up upgrading to v6 as more up-dated versions although works are breaking the typescript in many places. As you mentioned the newer versions don't seems to have complicated breaking changes fixes but for a reason the @types/puppeteer does introduce many changes in versions later then v6 so as you stated that it is good enough I ended up upgrading to v6. Before I merge & deploy, can you please pull and confirm the fix for the core version? |
@esakal It seems to be doing the trick :) |
🎉 This issue has been resolved in version 1.14.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Is the latest commit should just work on M1? When I executed
|
This has been discussed here: puppeteer/puppeteer#6622 and here: puppeteer/puppeteer#6634
There are a few things that need to happen here:
puppeteer
topuppeteer-core
executablePath
to the packageThe text was updated successfully, but these errors were encountered: