Code: Select all
from selenium import webdriver
driver = webdriver.Chrome()
image= ""
driver.get(image)
image_element = driver.find_element(By.TAG_NAME, "img")
image_data = image_element.screenshot_as_png
file_path = "/domains/example.com/public_html/file/"
with FTP('ip', 'user', 'pass') as ftp, open(image_data, 'rb') as file:
ftp.storbinary(f'STOR {file_path + image_data.name}', file)