Skip to content

add more ways to configure web browser from command-line#91

Open
looran wants to merge 4 commits into
simonw:mainfrom
looran:browser_controls
Open

add more ways to configure web browser from command-line#91
looran wants to merge 4 commits into
simonw:mainfrom
looran:browser_controls

Conversation

@looran

@looran looran commented Oct 1, 2022

Copy link
Copy Markdown
  • option to use system browser
  • option to add custom browser command-line arguments
  • option to ignore https headers

📚 Documentation preview 📚: https://shot-scraper--91.org.readthedocs.build/en/91/

@simonw

simonw commented Oct 14, 2022

Copy link
Copy Markdown
Owner

This is an interesting set of improvements.

I couldn't get the --system-browser option to work on macOS - do you know if there's a way to use it there?

I tried these:

>>> distutils.spawn.find_executable('Chrome')
>>> distutils.spawn.find_executable('chrome')
>>> distutils.spawn.find_executable('Firefox')
>>> distutils.spawn.find_executable('Firefox.app')
>>> distutils.spawn.find_executable('firefox')

None returned a path.

@looran

looran commented Oct 15, 2022

Copy link
Copy Markdown
Author

Does shutil.which works on your platform ? It looks like a more suited replacement.

In [1]: import shutil
In [2]: shutil.which('chromium')
Out[3]: '/usr/bin/chromium'

* option to use system browser
* option to add custom browser command-line arguments
* option to ignore https headers
@simonw

simonw commented Oct 24, 2022

Copy link
Copy Markdown
Owner

Relevant: apparently distutils.spawn.find_executable is deprecated and scheduled for removal in Python 3.12:

@looran

looran commented Oct 26, 2022

Copy link
Copy Markdown
Author

I'm now using shutil.which in my branch, can you test if it now works on mac ?

@simonw simonw linked an issue Dec 28, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants