|
56 | 56 | in <code>Supported Python Versions</code> on <a href=https://pypi.org/project/selenium/>PyPi</a></p><p>There are a couple different ways to install Selenium.</p><h3 id=pip>Pip</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>pip install selenium
|
57 | 57 | </span></span></code></pre></div><br><h3 id=download>Download</h3><p>Alternatively you can download the <a href=https://pypi.org/project/selenium/#files>PyPI source archive</a>
|
58 | 58 | (selenium-x.x.x.tar.gz) and install it using <em>setup.py</em>:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>python setup.py install
|
59 |
| -</span></span></code></pre></div><br><h3 id=require-in-project>Require in project</h3><p>To use it in a project, add it to the <code>requirements.txt</code> file:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-txt data-lang=txt><span style=display:flex><span>selenium==4.25.0</span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/requirements.txt#L1 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
| 59 | +</span></span></code></pre></div><br><h3 id=require-in-project>Require in project</h3><p>To use it in a project, add it to the <code>requirements.txt</code> file:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-txt data-lang=txt><span style=display:flex><span>selenium==4.26.0</span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/requirements.txt#L1 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
60 | 60 | <strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-00-02 role=tabpanel aria-labelled-by=tabs-00-02-tab tabindex=0><p>A list of all supported frameworks for each version of Selenium
|
61 | 61 | is available on <a href=https://www.nuget.org/packages/Selenium.WebDriver>Nuget</a></p><p>There are a few options for installing Selenium.</p><h3 id=packet-manager>Packet Manager</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>Install-Package Selenium.WebDriver
|
62 | 62 | </span></span></code></pre></div><br><h3 id=net-cli>.NET CLI</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>dotnet add package Selenium.WebDriver
|
|
79 | 79 | Press Enter and select the version.
|
80 | 80 | Now you can use the examples in the documentation related to C# with vscode.</p></div><div class="tab-body tab-pane fade" id=tabs-00-03 role=tabpanel aria-labelled-by=tabs-00-03-tab tabindex=0><p>You can see the minimum required version of Ruby for any given Selenium version
|
81 | 81 | on <a href=https://rubygems.org/gems/selenium-webdriver/>rubygems.org</a></p><p>Selenium can be installed two different ways.</p><h3 id=install-manually>Install manually</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>gem install selenium-webdriver
|
82 |
| -</span></span></code></pre></div><br><h3 id=add-to-projects-gemfile>Add to project’s gemfile</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-Gemfile data-lang=Gemfile><span style=display:flex><span><span style=color:#000>gem</span> <span style=color:#4e9a06>'selenium-devtools'</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>'= 0.129.0'</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/Gemfile#L10 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
| 82 | +</span></span></code></pre></div><br><h3 id=add-to-projects-gemfile>Add to project’s gemfile</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-Gemfile data-lang=Gemfile><span style=display:flex><span><span style=color:#000>gem</span> <span style=color:#4e9a06>'selenium-devtools'</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>'= 0.130.0'</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/Gemfile#L10 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
83 | 83 | <strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-00-04 role=tabpanel aria-labelled-by=tabs-00-04-tab tabindex=0><p>You can find the minimum required version of Node for any given version of Selenium in the
|
84 | 84 | <code>Node Support Policy</code> section on <a href=https://www.npmjs.com/package/selenium-webdriver>npmjs</a></p><p>Selenium is typically installed using npm.</p><h3 id=install-locally>Install locally</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>npm install selenium-webdriver
|
85 | 85 | </span></span></code></pre></div><br><h3 id=add-to-project>Add to project</h3><p>In your project’s <code>package.json</code>, add requirement to <code>dependencies</code>:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-json data-lang=json><span style=display:flex><span> <span style=color:#4e9a06>"mocha"</span><span style=color:#a40000>:</span> <span style=color:#4e9a06>"10.7.3"</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/javascript/package.json#L14 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
|
|
7413 | 7413 | <strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-05-01 role=tabpanel aria-labelled-by=tabs-05-01-tab tabindex=5><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-py data-lang=py><span style=display:flex><span> <span style=color:#204a87;font-weight:700>async</span> <span style=color:#204a87;font-weight:700>with</span> <span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>bidi_connection</span><span style=color:#000;font-weight:700>()</span> <span style=color:#204a87;font-weight:700>as</span> <span style=color:#000>connection</span><span style=color:#000;font-weight:700>:</span>
|
7414 | 7414 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>connection</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>session</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>execute</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>connection</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>devtools</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>performance</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>enable</span><span style=color:#000;font-weight:700>())</span>
|
7415 | 7415 | </span></span><span style=display:flex><span> <span style=color:#000>metric_list</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>connection</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>session</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>execute</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>connection</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>devtools</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>performance</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>get_metrics</span><span style=color:#000;font-weight:700>())</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk//examples/python/tests/bidi/cdp/test_network.py#L26-L28 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
|
7416 |
| -<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-05-02 role=tabpanel aria-labelled-by=tabs-05-02-tab tabindex=5><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cs data-lang=cs><span style=display:flex><span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>domains</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Performance</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Enable</span><span style=color:#000;font-weight:700>(</span><span style=color:#204a87;font-weight:700>new</span> <span style=color:#000>OpenQA</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Selenium</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>DevTools</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>V129</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Performance</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>EnableCommandSettings</span><span style=color:#000;font-weight:700>());</span> |
| 7416 | +<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-05-02 role=tabpanel aria-labelled-by=tabs-05-02-tab tabindex=5><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cs data-lang=cs><span style=display:flex><span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>domains</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Performance</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Enable</span><span style=color:#000;font-weight:700>(</span><span style=color:#204a87;font-weight:700>new</span> <span style=color:#000>OpenQA</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Selenium</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>DevTools</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>V13</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Performance</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>EnableCommandSettings</span><span style=color:#000;font-weight:700>());</span> |
7417 | 7417 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700>var</span> <span style=color:#000>metricsResponse</span> <span style=color:#000;font-weight:700>=</span>
|
7418 | 7418 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>session</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>SendCommand</span><span style=color:#000;font-weight:700><</span><span style=color:#000>GetMetricsCommandSettings</span><span style=color:#000;font-weight:700>,</span> <span style=color:#000>GetMetricsCommandResponse</span><span style=color:#000;font-weight:700>>(</span>
|
7419 | 7419 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700>new</span> <span style=color:#000>GetMetricsCommandSettings</span><span style=color:#000;font-weight:700>()</span>
|
|
0 commit comments