3

Apparently, Selenium uses port 4444 by default. Would it be possible to customize this in Python so that multiple instances of the same application could be spawned simultaneously?

This is how I currently initialize the browser in Python:

from selenium import webdriver
driver = webdriver.Chrome(PATH_TO_CHROMEDRIVER_EXE)
...
driver.quit()
Eivind
  • 301
  • 6
  • 18
  • 1
    Possible duplicate of [How do you set the port for ChromeDriver in Selenium?](http://stackoverflow.com/questions/38270270/how-do-you-set-the-port-for-chromedriver-in-selenium) – Linh Nguyen Jan 12 '17 at 15:13
  • @LinhNguyen Not Python though. – Eivind Jan 12 '17 at 15:30

1 Answers1

3

You can add port information while creating the chrome webdriver, for eg.

from selenium import webdriver
driver = webdriver.Chrome(PATH_TO_CHROMEDRIVER_EXE, port=8080)

this will set the port on which the driver will be running

vivek gupta
  • 103
  • 1
  • 12
pfctdayelise
  • 5,115
  • 3
  • 32
  • 52
  • Code-only answers are discouraged because they do not explain how they resolve the issue in the question. Consider updating your answer to explain what this does and how it addresses the problem. Please review [How do I write a good answer](https://stackoverflow.com/help/how-to-answer) – FluffyKitten Sep 14 '17 at 05:18