There is no built-in to selenium way to wait for the download to be completed.
The general idea here would be to wait until a file would appear in your "Downloads" directory.
This might either be achieved by looping over and over again checking for file existence:
Check and wait until a file exists to read it:
import os.path
import time
while not os.path.exists(file_path):
time.sleep(1)
if os.path.isfile(file_path):
# read file
else:
raise ValueError("%s isn't a file!" % file_path)
Hope this helps!!
If you need to learn more about Python, It's recommended to join Python Programming course today.
Thanks!