每当我们调用 Firefox 时,都会在“/tmp”目录下创建 rust_mozprofile 目录。由于 Firefox 内部调用 Geckodriver,我们不确定 Firefox 还是 Geckodriver 正在创建 rust_mozprofile 目录。
我确实想知道是 Geckodriver 还是 Firefox,因为我的“/tmp”目录内存较少。
所以问题是我真的想修改为rust_mozprofile创建目录的路径。
我正在使用以下技术,
- Selenium - 3.3.0
- 火狐 - 52.2.0
- 壁虎驱动器 - 13
如果有任何建议,请给我们一些建议。
最佳答案
如果您仔细查看 geckodriver v0.18.0 日志,您会发现 rust_mozprofile
的第一次出现出现在以下行中:
1504762617094 Marionette CONFIG Matched capabilities: {"browserName":"firefox","browserVersion":"56.0","platformName":"windows_nt","platformVersion":"6.2","pageLoadStrategy":"normal","acceptInsecureCerts":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":5848,"moz:profile":"C:\\Users\\AtechM_03\\AppData\\Local\\Temp\\rust_mozprofile.OfFuR9ogm33d","moz:accessibilityChecks":false,"moz:headless":false}
此日志清楚地表明 marionette正在配置:
"moz:profile":"C:\\Users\\AtechM_03\\AppData\\Local\\Temp\\rust_mozprofile.OfFuR9ogm33d"
而这个配置是由 WebDriver 完成的实例,即 GeckoDriver。
GeckoDriver 在内部配置 Marionette,进而启动 Mozilla Firefox 浏览器。
IMO,自从我们从旧版 Firefox 迁移到基于 Marionette 的 Firefox 以来,此工作流程就已付诸实践。因此,Geckodriver - 13 的情况也一定如此。
<小时/>更新:
关于selenium - 是 Firefox 还是 Geckodriver,它创建了 "rust_mozprofile"目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46088442/