Browse Source

Scraping

pull/175/head
Jure Šorn 1 year ago
parent
commit
1f65ddfd1c
2 changed files with 4 additions and 4 deletions
  1. 2
      README.md
  2. 6
      index.html

2
README.md

@ -2512,7 +2512,7 @@ from selenium import webdriver
<El>.click/clear() # Also <El>.send_keys(<str>).
```
#### XPath — also available in browser's console via `'$x(<xpath>)'`:
#### XPath — also available in browser's console via `'$x(<xpath>)'` and by lxml library:
```python
<xpath> = //<element>[/ or // <element>] # Child: /, Descendant: //, Parent: /..
<xpath> = //<element>/following::<element> # Next sibling. Also preceding/parent/…

6
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>February 13, 2024</aside>
<aside>February 15, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -2074,7 +2074,7 @@ print(<span class="hljs-string">f'<span class="hljs-subst">{python_url}</span>,
</code></pre></div>
<div><h4 id="xpathalsoavailableinbrowsersconsoleviadxxpath">XPath — also available in browser's console via <code class="python hljs"><span class="hljs-string">'$x(&lt;xpath&gt;)'</span></code>:</h4><pre><code class="python language-python hljs">&lt;xpath&gt; = //&lt;element&gt;[/ <span class="hljs-keyword">or</span> // &lt;element&gt;] <span class="hljs-comment"># Child: /, Descendant: //, Parent: /..</span>
<div><h4 id="xpathalsoavailableinbrowsersconsoleviadxxpathandbylxmllibrary">XPath — also available in browser's console via <code class="python hljs"><span class="hljs-string">'$x(&lt;xpath&gt;)'</span></code> and by lxml library:</h4><pre><code class="python language-python hljs">&lt;xpath&gt; = //&lt;element&gt;[/ <span class="hljs-keyword">or</span> // &lt;element&gt;] <span class="hljs-comment"># Child: /, Descendant: //, Parent: /..</span>
&lt;xpath&gt; = //&lt;element&gt;/following::&lt;element&gt; <span class="hljs-comment"># Next sibling. Also preceding/parent/…</span>
&lt;element&gt; = &lt;tag&gt;&lt;conditions&gt;&lt;index&gt; <span class="hljs-comment"># `&lt;tag&gt; = */a/…`, `&lt;index&gt; = [1/2/…]`.</span>
&lt;condition&gt; = [&lt;sub_cond&gt; [<span class="hljs-keyword">and</span>/<span class="hljs-keyword">or</span> &lt;sub_cond&gt;]] <span class="hljs-comment"># For negation use `not(&lt;sub_cond&gt;)`.</span>
@ -2932,7 +2932,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the activ
<footer>
<aside>February 13, 2024</aside>
<aside>February 15, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Loading…
Cancel
Save