from os import listdir
from os.path import isfile,join
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time
mypath = 'abcd' #acá va la dirección del folder con las imágenes que quieres subir (si tu folder tiene la forma C:\carpeta... tienes que duplicar los '\')
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
driver = webdriver.Chrome()
driver.maximize_window()
hilo = 'https://www.hispachan.org/ac/res/161492.html' #acá va la dirección del hilo en el cual quieres hacer el dump

for filename in onlyfiles:
    ubicacion=mypath+'\\'+filename
    print (ubicacion)
    driver.get(hilo)
    element=driver.find_element(By.XPATH,'//*[@id="postform"]/table/tbody/tr[3]/td[2]/input')
    element.send_keys(ubicacion)
    element=driver.find_element(By.XPATH,'//*[@id="postform"]/table/tbody/tr[1]/td[2]/input').click()
    print ('enviando una imagen')
    time.sleep(20)


Edit
Pub: 22 Jul 2021 18:00 UTC
Edit: 22 Jul 2021 18:08 UTC
Views: 231