I want to pause my python script while waiting for a file download to happen. I don't want to use an explicit wait. I want this to run fast and not rely on an explicit wait. I'm kinda noobish but here is what I have tried.
file_check = glob.glob1('downloads', '*.pdf')
while not os.path.isfile(str(file_check)):
time.sleep(1)
I used the str() because it complained about needing a string for the path. I have a feeling this isn't the way to properly do this. so how should I dynamically wait for a file download?
P.S My .pdf file downloads into '/downloads', and my pdf is dynamically named before download so that's why I need globs wildcard.