docs: general correction across all the pages
Automated. I don't know how I missed all of that!
This commit is contained in:
@@ -145,7 +145,7 @@ Examples:
|
||||
>>> page = Selector(html_doc, adaptive=True)
|
||||
# OR
|
||||
>>> Fetcher.adaptive = True
|
||||
>>> page = Fetcher.fetch('https://example.com')
|
||||
>>> page = Fetcher.get('https://example.com')
|
||||
```
|
||||
If you are using the [Selector](main_classes.md#selector) class, you need to pass the url of the website you are using with the argument `url` so Scrapling can separate the properties saved for each element by domain.
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ Apart from the standard operations on Python lists, such as iteration and slicin
|
||||
|
||||
You can do the following:
|
||||
|
||||
Execute CSS and XPath selectors directly on the [Selector](#selector) instances it has, while the arguments and the return types are the same as [Selector](#selector)'s `css` and `xpath` methods. This, of course, makes chaining methods very straightforward.
|
||||
Execute CSS and XPath selectors directly on the [Selector](#selector) instances it has, while the return types are the same as [Selector](#selector)'s `css` and `xpath` methods. The arguments are similar, except the `adaptive` argument is not available here. This, of course, makes chaining methods very straightforward.
|
||||
```python
|
||||
>>> page.css('.product_pod a')
|
||||
[<data='<a href="catalogue/a-light-in-the-attic_...' parent='<div class="image_container"> <a href="c...'>,
|
||||
|
||||
@@ -398,7 +398,7 @@ Find all div elements with a class that equals `quote` and contains the element
|
||||
>>> page.find_all('div', {'class': 'quote'}, lambda e: "world" in e.css('.text::text').get())
|
||||
[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>]
|
||||
```
|
||||
Find all elements that don't have children.
|
||||
Find all elements that have children.
|
||||
```python
|
||||
>>> page.find_all(lambda element: len(element.children) > 0)
|
||||
[<data='<html lang="en"><head><meta charset="UTF...'>,
|
||||
|
||||
Reference in New Issue
Block a user