How to run/deploy playwright on Heroku?
To start with what is playwright? Its a framework to enable end-2-end testing for web apps. But its not the only use case of playwright. Web scraping is also another use case we can use it for.
Doing scraping is very easy with playwright as it gives you an option where you can navigate through the workflow and it will generate the code for you. There are many languages support for that.
you can get started with with the below command
npx playwright codegen <url> . This will open the url entered and the playwright inspector and one has many options to select the language of choice code.
All one has to do is add the playwright build pack. To run the playwright on Heroku the container needs the right build pack and order matters. Make sure its first and then running environment. In my case its node.
My app is exposed as an API and now I can use the playwright capabilities. Let me know if you have questions I am happy to help. Happy learning happy coding.