from selenium import webdriver
import time
import win32clipboard
import win32api
import win32con
from selenium.webdriver.common.action_chains import ActionChains
def keyDown(keyName):
win32api.keybd_event(VK_CODE[keyName],0,0,0)
def keyUp(keyName):
win32api.keybd_event(VK_CODE[keyName],0,win32con.KEYEVENTF_KEYUP,0)
VK_CODE={'enter':0x0D,'down_arrow':0x28}
url2=''
#browser= webdriver.Chrome(executable_path=r'D:/Automation/chromedriver.exe')
browser= webdriver.Chrome()
browser.maximize_window()
browser.get(url2)
time.sleep(2)
path='E:\\'
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(path)
win32clipboard.CloseClipboard()
img=browser.find_element_by_xpath('//*[@id="currentImg"]')
action = ActionChains(browser).move_to_element(img)
action.context_click(img).perform()
time.sleep(1)
win32api.keybd_event(86,0,0,0)
time.sleep(1)
win32api.keybd_event(0x11, 0, 0, 0)
win32api.keybd_event(0x56, 0, 0, 0)
win32api.keybd_event(0x56, 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(0x11, 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(0x0D,0,0,0)
win32api.keybd_event(0x12, 0, 0, 0)
win32api.keybd_event(0x53, 0, 0, 0)
win32api.keybd_event(0x53, 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(0x12, 0, win32con.KEYEVENTF_KEYUP, 0)
keyDown('enter')
keyUp('enter')
time.sleep(1)
print('over')