如何在 Selenium 中使用 Chrome 查看 flash cookie

How do I view flash cookies using Chrome in Selenium

我正在尝试将 selenium 与 .NET (C#) 结合使用以从特定 URL(在本例中为 kongregate 上的游戏)提取 Flash cookie。对于我个人使用的浏览器,我知道 Flash Cookie 的物理存储位置。我尝试使用 google Chrome 目录中的物理位置访问 flash cookies (Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot#SharedObjects),然而,这对使用 selenium 收集的 flash cookies 没有影响。我怎样才能访问通过我的 selenium 实例存储的共享对象文件?

尝试加载自定义 Chrome 配置文件,看看是否有帮助。这是一个简单的例子。

ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=/path/to/your/custom/profile");

有关详细信息,请参阅 here