반응형
마우스 hover
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
driver.get("<https://search.naver.com/search.naver?sm=tab_hty.top&where=image&query=%EC%A0%9C%EB%8B%88+%EB%AA%B8%EB%A7%A4&oquery=%EC%A0%9C%EB%8B%88&tqi=hWrBZlprvhGssENmzH4ssssss%2BN-392016>")
time.sleep(7)
# 마우스 hover 효과
action = ActionChains(driver)
action.move_to_element(driver.find_element(by=By.XPATH, value="//*[@id='main_pack']/section[2]/div/div[1]/div[1]/div[1]/div/div[1]/a")).perform()
반응형