I wrote a python script to upload a video file into web portal using selenium library . Our video file name keep changing every hour. program A batch job creates a video with current date and writes to current working directory . Program b ( my python script) needs to upload that to website.
file_input = browser.find_element(By.XPATH, '//*[@id="content"]/input')
abs_path = os.path.abspath("Random.mp4") #"random" this keep changing every hour
file_input.send_keys(abs_path)
I need something like
abs_path = os.path.abspath("*.mp4") #any random filename *.mp4 needs to be uploaded . because it changes everytime. only one video file .mp4 exist at any point of time.
if i give as *.mp4 then python script fails.
Need suggestion to change the script logic.