【发布时间】:2021-02-04 19:54:26
【问题描述】:
我在 aws lambda 和 firefox 驱动程序上使用 python 3.8 + selenium 包
那么如何在 selenium 中设置 firefox 配置文件的下载位置?
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.downloads.folderList", 2)
profile.set_preference("browser.downloads.manager.showWhenStarting", False)
profile.set_preference("browser.downloads.dir","HOW TO SET S3 PATH HERE")
如果不是,那么实现它的最佳方法是什么
【问题讨论】:
-
firefox 只能使用本地目录,因此您的系统必须将 s3 挂载到文件系统,或者能够访问 s3 资源。您更有可能希望在本地下载,然后将其作为单独的进程上传到 s3。
标签: python-3.x selenium amazon-s3 aws-lambda selenium-firefoxdriver