“Selenium Python” Code-Antworten

Selenium 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 Selenium Python

$ pip install selenium
AlarmClockMan

Selenium Python

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

browser = webdriver.Firefox()

browser.get('http://www.yahoo.com')

# Find the search box
elem = browser.find_element(By.NAME, 'p')
# Types seleniumhq and RETURN/ENTER
elem.send_keys('seleniumhq' + Keys.RETURN)

browser.quit()
Defeated Deer

Ähnliche Antworten wie “Selenium Python”

Fragen ähnlich wie “Selenium Python”

Weitere verwandte Antworten zu “Selenium Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen