I wanted to upload a file on site ‘https://www.cutout.pro/photo-enhancer-sharpener-upscaler/upload’ using library selenium. Can you help me?
<code>from selenium import webdriver
from time import sleep
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.add_argument('window-size=2560,1440')
url = 'https://www.cutout.pro/photo-enhancer-sharpener-upscaler/upload'
driver = webdriver.Chrome(executable_path='G:/check file/python/image scraping 2/chromedriver.exe',options=options)
driver.get(url)
s = driver.find_element_by_xpath("/html/body/div/div/div/div/div[2]/div/div[1]/div/div[2]/div/button")
sleep(5)
s.send_keys("G:/check file/python/image scraping 2/1.jpg")
</code>
<code>from selenium import webdriver
from time import sleep
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.add_argument('window-size=2560,1440')
url = 'https://www.cutout.pro/photo-enhancer-sharpener-upscaler/upload'
driver = webdriver.Chrome(executable_path='G:/check file/python/image scraping 2/chromedriver.exe',options=options)
driver.get(url)
s = driver.find_element_by_xpath("/html/body/div/div/div/div/div[2]/div/div[1]/div/div[2]/div/button")
sleep(5)
s.send_keys("G:/check file/python/image scraping 2/1.jpg")
</code>
from selenium import webdriver
from time import sleep
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.add_argument('window-size=2560,1440')
url = 'https://www.cutout.pro/photo-enhancer-sharpener-upscaler/upload'
driver = webdriver.Chrome(executable_path='G:/check file/python/image scraping 2/chromedriver.exe',options=options)
driver.get(url)
s = driver.find_element_by_xpath("/html/body/div/div/div/div/div[2]/div/div[1]/div/div[2]/div/button")
sleep(5)
s.send_keys("G:/check file/python/image scraping 2/1.jpg")
But this doesn’t work and it asks me to re-upload the file in the site