Dokümantasyon olarak aşağıdaki siteyi kullanıyoruz:

https://selenium-python.readthedocs.io/

Kurulum için:

pip install selenium

Sürücü yüklemeleri için:

Chromehttps://sites.google.com/a/chromium.org/chromedriver/downloads
Edgehttps://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Firefoxhttps://github.com/mozilla/geckodriver/releases
Safarihttps://webkit.org/blog/6900/webdriver-support-in-safari-10/

Videodaki kodlar:

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

driver = webdriver.Chrome(r'D:\Softic Yazilim\Kurslar\YouTube\Selenium\chromedriver.exe')

driver.get('https://www.softicyazilim.com')

time.sleep(3)

# yazi = driver.find_element_by_link_text("PYTHON")
yazi = driver.find_element_by_link_text("BLOG")
yazi.click()

time.sleep(3)

driver.back()

time.sleep(3)

# ara_dugme = driver.find_element_by_id("header-search")
ara_dugme = driver.find_element_by_id("search-toggle")
ara_dugme.click()

time.sleep(3)

# ara_yazi = driver.find_element_by_class_name("search")
ara_yazi = driver.find_element_by_class_name("search-field")
ara_yazi.send_keys("selenium", Keys.RETURN)

time.sleep(3)

driver.refresh()

time.sleep(3)

driver.close()

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir