“Chrome Driver Selenium Python Compiller online” Kod odpowiedzi

Otwórz stronę internetową za pomocą selenium Python

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

driver = webdriver.Chrome('./chromedriver')
driver.get("https://www.python.org")
print(driver.title)
search_bar = driver.find_element_by_name("q")
search_bar.clear()
search_bar.send_keys("getting started with python")
search_bar.send_keys(Keys.RETURN)
print(driver.current_url)
driver.close()
Adorable Antelope

Chrome Driver Selenium Python Compiller online

driver = webdriver.Chrome()
driver.get("http://practice.automationtesting.in/")
driver.implicitly_wait(5)
driver.maximize_window()

driver.execute_script("window.scrollBy(0, 600);")
read_more_btn = driver.find_element_by_css_selector(".post-160 > a > h3") # li.post-160 a:nth-child(2)
read_more_btn.click()
reviews_btn = driver.find_element_by_css_selector(".reviews_tab > a")
reviews_btn.click()
five_star_btn = driver.find_element_by_css_selector(".star-5")
five_star_btn.click()
your_review_field = driver.find_element_by_id("comment")
your_review_field.send_keys("Nice book!")
name_field = driver.find_element_by_id("author")
name_field.send_keys("Test_Name")
email_field = driver.find_element_by_id("email")
email_field.send_keys("[email protected]")
submit_btn = driver.find_element_by_id("submit")
submit_btn.click()

driver.quit()
nata Natino

Chrome Driver Selenium Python Compiller online

isdbksd sdjbfbs
Odd Osprey

Chrome Driver Selenium Python Compiller online

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome('./chromedriver')
driver.get("https://www.python.org")
print(driver.title)
K Niharika

Odpowiedzi podobne do “Chrome Driver Selenium Python Compiller online”

Pytania podobne do “Chrome Driver Selenium Python Compiller online”

Więcej pokrewnych odpowiedzi na “Chrome Driver Selenium Python Compiller online” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu