Forum Discussion
How to run playwright in notebook
- 8 months ago
Hi minhnhatdanchoi ,
As you found, Fabric notebooks cannot run Playwright directly right now. The easiest way is to run your Playwright scripts on your laptop, an Azure VM, or a Databricks notebook where it works fully, and then bring the results into Fabric. If you want to do web scraping or automation inside Fabric, using APIs with Python (requests/httpx) or official SDKs can work without needing a browser. If running Playwright directly in Fabric is very important for you, you may also consider raising a Microsoft support ticket for guidance or to request feature support.To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
Hi minhnhatdanchoi,
You can either install them in an environment and use that environment in your notebook as described here:
Library Management in Fabric Environments - Microsoft Fabric | Microsoft Learn
Or you can use the %pip install magic command at the top of your notebook. That is outlined here:
Manage Apache Spark libraries - Microsoft Fabric | Microsoft Learn
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
- tusharverma9 months agoNew Member
reply
- minhnhatdanchoi9 months agoFrequent Visitor
I can't install because it require sudo command
I need to run '!playwright install' to install dependencies- v-sshirivolu9 months agoCommunity Support
Hi minhnhatdanchoi ,
The reason !playwright install isn’t working is that it normally requires elevated permissions to install browser binaries system-wide, which isn’t available in a Fabric notebook. In this environment, the recommended approach is to rely on user-level installation methods or the pre-installed browser dependencies provided by the platform, which allows you to run Playwright code without needing sudo while staying within the platform’s security rules.- minhnhatdanchoi9 months agoFrequent Visitor
How can I use pre-installed browser dependencies with playwright in Fabric notebook. Any document about this ?
- minhnhatdanchoi9 months agoFrequent Visitor
tayloramy tusharverma
Sorry for not reply soon, I'm moving company last week