“Driver Chrome Selenium Python Online Compiler” Kode Jawaban

Buka halaman web menggunakan 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

Driver Chrome Selenium Python Online Compiler

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

Driver Chrome Selenium Python Online Compiler

isdbksd sdjbfbs
Odd Osprey

Driver Chrome Selenium Python Online Compiler

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

Jawaban yang mirip dengan “Driver Chrome Selenium Python Online Compiler”

Pertanyaan yang mirip dengan “Driver Chrome Selenium Python Online Compiler”

Lebih banyak jawaban terkait untuk “Driver Chrome Selenium Python Online Compiler” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya