File Upload with Selenium

Yesterday, my brother asked me: "How to automatic upload a file with Selenium". Today, i had free time to solve it.
Try this code. I used python blinding:
from selenium import webdriver
url = "https://encodable.com/uploaddemo/"
driver = webdriver.Firefox()
driver.get(url)
element = driver.find_element_by_id("uploadname1")
element.send_keys("/home/habachnam/a.txt")
----------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
Security Research
SecurityLab - Linux Lab -- Window and Cisco Lab
to be continued - I will update more.

Comments

Popular posts from this blog

Python - Multithread to read one file

Install Xposed Inspector and Frida on Genymotion

OpenCA tutorial