Monday, 4 September 2023

How to use the Playwright library in a Jupyter notebook instead of using a regular .py script (on Windows)

I want to use an automated browser and execute my steps with jupyter notebook cells instead of using .py scripts. This works fine with the browser automation library called selenium.

It does not work fine with the library called Playwright. In fact it doesn't work at all. I tried every single line of code they provided in their manual. NOTHING works in jupyter notebooks. EVERYTHING works fine on my machine as long as copy-pasting the same code in some .py file and executing it. Various examples that I'm talking about can be found here: https://playwright.dev/python/docs/intro

I really don't get why I'm unable to make it work in a jupyter notebook, especially if it works fine in literally every .py file.

Edit: Apparently it works on mac but I use windows



from How to use the Playwright library in a Jupyter notebook instead of using a regular .py script (on Windows)

No comments:

Post a Comment