“Selenium Webdriver Python” Code-Antworten

Selenium Webdriver Python

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)
assert "No results found." not in driver.page_source
driver.close()
Annoyed Alligator

Installieren Sie Python Selenium Webdriver

python -m pip install selenium
Defeated Dogfish

Selenium Webdriver Optionen Python

#to add options to selenium, put:
from selenium.webdriver.chrome.options import Options
#at the top of your python file

#to use the options, use this code:
options = Options()
options.add_argument("--headless")
options.add_argument("--log-level NONE")

#to pass the arguments to the driver, use this:
driver = webdriver.Chrome(executable_path="path", options=options)
The God of Monkeys

Python -Selen -Fahrer

service = Service(executable_path="/path/to/chromedriver")
driver = webdriver.Chrome(service=service)
Puzzled Puffin

Ähnliche Antworten wie “Selenium Webdriver Python”

Fragen ähnlich wie “Selenium Webdriver Python”

Weitere verwandte Antworten zu “Selenium Webdriver Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen