0

I'm learning Selenium and trying to understand the parameters of the methods Chromdriver's Options class like add_argument, add_experimental_option, and so on. Where can I find information about these parameters?

I have referred to some documentation, but it seems that it's not enough, as there are some parameters that I couldn't find in the documentation. Can someone please explain this to me? I have tried to research it, but I still don't understand it clearly.

screenshot of usage

gavin
  • 793
  • 1
  • 7
  • 19

1 Answers1

0

There are command-line switches that Chromium (and Chrome) accept in order to enable particular features or modify otherwise default functionality.

google-chrome --remote-debugging-port=9222

You can read more about running Chrome with command line params here.

Selenium provides the APIs to enable fine-grain control of your browser - in this case, Chrome. You can refer to the following documentation to get a high-level idea of the available methods & attributes for the Options interface.

options = Options()
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-setuid-sandbox")
options.add_argument('--disable-infobars')

You can read more about the different available APIs under the Options interface here.

To understand what options are available (which may vary depending on the version of your browser), you can refer to Chrome's official API documentation. Additionally, there are other resources online that try to compile this information in a common place:

gavin
  • 793
  • 1
  • 7
  • 19
  • Is its parameter called a command-line flag? And if so, how do I know the corresponding value to pass into the add_experimental_option function? – chens11111010001 Jun 19 '23 at 13:03
  • I want to find additional experimental parameters. Where can I find them? I have searched everywhere, but I couldn't find any descriptions or related experimental parameters. They only exist in the code references without any other documentation or descriptions. – chens11111010001 Jun 19 '23 at 18:10