yammering-amber•2y ago
How to upgrade Crawlee+Playwright to the latest versions?
6 month ago I created a Crawlee+Playwright+"node-beanstalk"(a JS wrapper for Beanstalkd message queue) project. I was following Crawlee documentation, created some... template? and started to add things to this template (no Docker image was used. I just installed things on Ubuntu machine).
And somehow it works (and it still wonders me)))
This is the versions used at the moment (my package.json is below, feel free to take look/criticize, i know it is not perfect):
Now I see that the latest Crawlee version is 3.5, latest Playwright is 1.39 and may be some other packages are updated. It is time to update.
So, what is the proper way to update Crawlee and Playwright in such project?
Is it just this:
Or something else?
I use headless Firefox it is installed here:
~/.cache/ms-playwright/firefox-1403/
How to update it?
Disclaimer: i am not a JS developer, i am Java developer who somehow writes JS code (lot of copy/paste, yes) so I know that dependency management is not that easy, so I think it is better to ask in this forum than create a mess is my project...4 Replies
yammering-amberOP•2y ago
my package.json:
other-emerald•2y ago
simply type
npm i crawlee
npm i playwright
this will install latest version, you can check it here
https://www.npmjs.com/package/crawlee
https://www.npmjs.com/package/playwright
npm
crawlee
The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.. Latest version: 3.5.8, last published: 23 days ago. Start using crawlee in your project by running
npm i crawlee
. There are 26 other projects in the npm registry u...npm
playwright
A high-level API to automate web browsers. Latest version: 1.39.0, last published: a month ago. Start using playwright in your project by running
npm i playwright
. There are 617 other projects in the npm registry using playwright.In JS, you usually have also
package-lock.json
which keeps your versions and only upgrades if you force it in package.json
. You can do that by setting the minimal version like this:
yammering-amberOP•2y ago
I think these are correct steps:
edit package.json
npm i crawlee
npm i playwright
npx playwright install
npm run build
Without
npx playwright install
it writes into log:
Looks like Playwright Test or Playwright was just installed or updated. Please run the following command to download new browsers: npx playwright install