Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
FelipeM
New Member

Installing webdriver for selenium

Has anyone successfully installed a WebDriver in the Fabric environment?

 

I attempted to place the WebDriver binaries in a Data Lake, but it didn’t work. I need to use Selenium to handle authentication for a single-page application, as Beautiful Soup is insufficient for this task.

 

I already checked this but they solution is outside fabric/bs4 Solved: Notebook Environment, Selenium installation - Microsoft Fabric Community

4 REPLIES 4
spencer_sa
Super User
Super User

Looks like the webdriver that gets installed when you use webdriver.Chrome(options=options)

is missing some dependencies - specifically libnss3.solibnssutil3.so, and libnspr4.so - that aren't installed in the native notebook OS of CBL-Mariner/Azure Linux.
Next steps (beyond contacting the Synapse team) might include trying to get those libraries/library files installed.  The package manager is tdnf, rather than apt.
[Edit - same dependency issue if you pip install chromedriver-py too]


(results of ldd <chromedriver path> below)

spencer_sa_0-1732186435382.png

 

v-jingzhan-msft
Community Support
Community Support

Hi @Sephir @FelipeM 

 

This might be a challenge in Fabric. When using Selenium locally, WebDriver can launch a locally installed browser (such as Chrome) to visit websites. However, in Fabric, notebooks run in an Apache Spark-based environment, which is a virtual environment and may not have a specific browser that WebDriver can launch. Therefore, even if WebDriver is available, the goal cannot be achieved due to the lack of web browser.

 

I could reproduce the same error as you have got: "WebDriverException: Message: Service /home/trusted-service-user/.cache/selenium/chromedriver/linux64/131.0.6778.85/chromedriver unexpectedly exited. Status code was: 127".

 

According to the error message, it seems it already has a chromedriver which is linux version. When we are using Selenium v4.6 and above we don't need to explicitly download ChromeDriver, GeckoDriver or any browser drivers as such. Selenium Manager would help to get a working environment to run Selenium out of the box. So it has prepared the chromedriver for the Fabric environment. Therefore I guess the cause of failure is the lack of browser in the Fabric environment.  

 

Update:

I read something about headless mode and browserless mode about Azure and Selenium, not sure if this could be applied to Fabric. I haven't tested this yet, to be honest. 

c# - Run Selenium Chrome WebDriver on Azure Cloud Service? - Stack Overflow

How to Run Selenium Driver in Azure for Data Collection | by Illiyas K | Medium

 

Best Regards,
Jing
Community Support Team

spencer_sa
Super User
Super User

Is there any reason %pip install selenium isn't working?  This screenshot is from one of my notebooks.

spencer_sa_1-1732091717291.png

 

If you are having issues with the pip repositories, we have managed to load .whl files dynamically from a lakehouse by mounting the lakehouse and loading from there with sys. libraries.

Selenium is already installed, but a compatible web driver is required to interact with web browser.

Sephir_0-1732147337249.png

@spencer_sa  are you able to start the driver and perform any operation? thanks for your time!

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.