# How to implement "Selenium" using python

**URL:** <https://community.firebasestudio.dev/t/how-to-implement-selenium-using-python/1443>\
**Category:** General\
**Created:** [August 14, 2024, 9:24am UTC](https://community.firebasestudio.dev/t/how-to-implement-selenium-using-python/1443 "2024-08-14T09:24:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![alice](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/alice/32/1234_2.png) [@alice](https://community.firebasestudio.dev/u/alice)\
**Post date:** [August 15, 2024, 12:08am UTC](https://community.firebasestudio.dev/t/how-to-implement-selenium-using-python/1443/2 "2024-08-15T00:08:16Z")

</div>

Sadly I could not make Chrome WebDriver work either, but using Firefox WebDriver works, I wrote this flake.nix file because stable-24.05 and unstable channels are outdated making firefox and geckodriver be incompatibles [at least that happened in my workspace].

```auto
{
  description = "Selenium Environment";

  inputs = {
    # using nixos-unstable because geckodriver is outdated in nixos-24.05
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:    
      let
        pkgs = import nixpkgs { inherit system; };
      in
      with pkgs;
      {
        devShells.default = mkShell {        
          buildInputs = [firefox geckodriver];

          # Somehow VSCode terminal pops up with "bash: __vsc_prompt_cmd_original: command not found"
          shellHook = ''
            unset PROMPT_COMMAND
          '';
        };
      }
    );
}

```

and respectively using the firefox driver in the Python code:

```python
options = webdriver.FirefoxOptions()
# required for idx.dev because no user interface is available
options.add_argument('--headless')
driver = webdriver.Firefox(options=options)

```

Otherwise we will have to wait for some solution If you really want to use the Chrome Web Driver.

---

_[View the full topic](https://community.firebasestudio.dev/t/how-to-implement-selenium-using-python/1443)._
