1

I have read the comments below for this question: What are the differences between 'Selenium-server-standalone.jar' and 'Selenium Client & WebDriver'?

I would like to ask: Can alone run webdriver without server? I only install selenium with "pip install selenium" and downloaded a chrome webdriver from chrome website.

If I run a code like this:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)

then my pc on a network at my workplace will work as a server ? Or my pc will work as normal, like if I just run a python like this without any modul:

print("hello")

I am worry about making a server of my pc at my workplace and cause some issue for my co-workers. I just want some task and process automate, I have a lot of copy-paste task from a website, which can be visited inside the company, so this website cannot be accessed by public. I am not a programmer (but have some experience in python), so I didnt learnt about networks, just an engineer who would like to make simplier/faster the tasks.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

As per How Does WebDriver ‘Drive’ the Browser Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. These direct calls and the features they support depends on the browser you are using.

The WebDriver consists of three separate pieces.

  • First of all, there is the Browser itself (e.g. Firefox / Chrome).
  • Next, the language bindings provided by the Selenium project (i.e. the Driver).
  • The executable downloaded either from GeckoDriver or ChromeDriver repository which acts as a bridge between Browser Client and the Driver. This executable is called WebDriver which we often refer as the Server to keep things simple.

So to execute you test you would require all these three pieces.

  • Mostly you will be having Firefox and Chrome browsers installed in your local system.
  • Start a command prompt using the cmd.exe program and run the pip command as given below to install selenium.

    pip install selenium
    
  • You can find a detailed discussion in Python : no module named selenium

  • The GeckoDriver and ChromeDriver can be downloaded from the respective locations.
  • Now, you can execute your script which is as follows:

    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    
    driver = webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe')
    driver.get("http://www.python.org")
    assert "Python" in driver.title
    elem = driver.find_element_by_name("q")
    elem.clear()
    elem.send_keys("pycon")
    elem.send_keys(Keys.RETURN)
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I've never heard anyone refer to WebDriver as the "Server" (even though it is one). When someone refers to the "Server" in the context of Selenium, they typically mean the Java-based Selenium Servers (as in Selenium Standalone or Selenium Grid Hub) – Corey Goldberg Nov 26 '18 at 21:29