webfp / tor-browser-selenium

Tor Browser automation with Selenium.
MIT License
548 stars 100 forks source link

set geckodriver binary location programmatically #137

Closed fontune closed 3 years ago

fontune commented 3 years ago

Hi guys, I really appreciate this project and it's been a great help.

This may just be me missing something but in Selenium WebDriver's Documentation there is an option to set the geckodriver binary location without using the PATH environment variable.

In webdriver it's done like this

Firefox(executable_path='/path/to/geckodriver')

Is this functionality present in tor-browser-selenium, or is using PATH a requirement? (And if this is not currently an option, do you plan to add it in the future?)

Thank you!

gunesacar commented 3 years ago

Thanks @fontune , This parameter is not implemented in tor-browser-selenium, but it can easily be added since we subclass FirefoxDriver.

We need to add a new parameter here: https://github.com/webfp/tor-browser-selenium/blob/master/tbselenium/tbdriver.py#L43 and pass the same parameter to the parent's constructor here: https://github.com/webfp/tor-browser-selenium/blob/master/tbselenium/tbdriver.py#L65

Are you interested in submitting a PR? It may take a couple of weeks for me to get to this.

fontune commented 3 years ago

Hi @gunesacar, I've submitted a PR #138 . I've used the same parameter name used by Selenium for consistency and added a small section on it to the README.

Thanks for replying so quickly.

gunesacar commented 3 years ago

Thanks, @fontune, the PR looks great. I'll merge it as soon as the CI tests pass.

fontune commented 3 years ago

Sounds good, thanks again for this project and for getting back to me so quickly.