<p>如果从命令行启动edge,则可以使用<code>msedge.exe -inprivate</code>启动inprivate-这就是您需要使用选项复制的内容</p>
<p>这就是我在c#中可以做到的:</p>
<pre class="lang-cs prettyprint-override"><code>case "edgechromium":
new DriverManager().SetUpDriver(new EdgeConfig(), "83.0.478.56");
var options = new EdgeOptions();
options.UseChromium = true;
options.AddArgument("-inprivate");
b = new EdgeDriver(options);
break;
</code></pre>
<p>对于python和您的代码,请尝试以下参数:</p>
<pre><code> options.add_argument("-inprivate")
</code></pre>
<hr/>
<p>[更新]
我看了一下<a href="https://pypi.org/project/msedge-selenium-tools/" rel="nofollow noreferrer">here</a>-这里有一些边缘工具可以帮助您</p>
<p>按照说明,我安装了以下工具:</p>
<pre><code>pip install msedge-selenium-tools selenium==3.141
</code></pre>
<p>我用python运行了这段更新的代码,包括inprivate标记</p>
<pre><code>from msedge.selenium_tools import Edge, EdgeOptions
# Launch Microsoft Edge (Chromium)
options = EdgeOptions()
options.use_chromium = True
options.add_argument("-inprivate")
driver = Edge(options = options)
driver.get ("https://www.google.com")
</code></pre>
<p>我得到了一份私人的工作
<a href="https://i.stack.imgur.com/whoih.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/whoih.png" alt="edge private"/></a></p>
<p>我正在使用:
<code>Version 84.0.522.52 (Official build) (64-bit)</code>-这是最新的,没有更新(根据更新工具)</p>