且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Selenium Webdriver和Firefox检测所有下载何时完成

更新时间:2023-11-29 21:01:46

Firefox和Chrome在下载文件时会创建文件和中间文件扩展名.对于chrome,它是 crdownload ,我不记得它在Firefox中是什么.但是,您可以下载大文件并进行检查.下载完成后,该中间文件将重命名为实际文件名.

Firefox and Chrome when downloads a file creates and intermediate file extensions. For chrome it's crdownload, I don't remember what it's for Firefox. However, you can download a large file and check. Once download is completed this intermediate file is renamed to actual file name.

所有您需要做的就是编写代码,检查是否存在任何具有crdownload扩展名的文件.如果没有,则说明下载已完成.

All you need to do it write a code which check if any file with crdownload extension is exist or not. if not, your download is completed.