Skip to content

Example of how to use google-chrome with nix-shell and python selenium

Notifications You must be signed in to change notification settings

owdevel/nix-shell-selenium-chrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Nix-shell Selenium with Google Chrome Binary

Simple example of using nix-shell to create a development environment for selenium in python using chromedriver and the google-chrome binary.

The nixpkgs version of google-chrome appends the channel (stable/beta/dev) to the binary name which causes selenium to not be able to find the correct binary as it is looking for the binary name google-chrome not google-chrome-stable.

This repo uses writeShellScriptBin to create a google-chrome script which exectues the correct binary. Credit goes to this reddit post for the idea.

Tested on nix-os 22.05.

TLDR

Add this to your shell.nix packages.

(pkgs.writeShellScriptBin "google-chrome" "exec -a $0 ${pkgs.google-chrome}/bin/google-chrome-stable $@")

Author's Note

As of writing this I'm still new to Nix-OS and the related ecosystem. If there is a better way of doing this please let me know :).

About

Example of how to use google-chrome with nix-shell and python selenium

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages