docs: update pages with the new media for testing zensical
This commit is contained in:
@@ -122,9 +122,9 @@ page = DynamicFetcher.fetch('https://example.com', proxy='http://username:passwo
|
|||||||
### Downloading Files
|
### Downloading Files
|
||||||
|
|
||||||
```python
|
```python
|
||||||
page = DynamicFetcher.fetch('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/images/poster.png')
|
page = DynamicFetcher.fetch('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/images/main_cover.png')
|
||||||
|
|
||||||
with open(file='poster.png', mode='wb') as f:
|
with open(file='main_cover.png', mode='wb') as f:
|
||||||
f.write(page.body)
|
f.write(page.body)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -275,8 +275,8 @@ def scrape_products():
|
|||||||
```python
|
```python
|
||||||
from scrapling.fetchers import Fetcher
|
from scrapling.fetchers import Fetcher
|
||||||
|
|
||||||
page = Fetcher.get('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/images/poster.png')
|
page = Fetcher.get('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/images/main_cover.png')
|
||||||
with open(file='poster.png', mode='wb') as f:
|
with open(file='main_cover.png', mode='wb') as f:
|
||||||
f.write(page.body)
|
f.write(page.body)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+31
-2
@@ -2,11 +2,16 @@
|
|||||||
.md-typeset h1 {
|
.md-typeset h1 {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
[data-md-color-scheme="default"] .only-dark { display: none; }
|
||||||
|
[data-md-color-scheme="slate"] .only-light { display: none; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<br/>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://scrapling.readthedocs.io/en/latest/" alt="poster">
|
<a href="https://scrapling.readthedocs.io/en/latest/" alt="poster">
|
||||||
<img alt="poster" src="assets/poster.png" style="width: 50%; height: 100%;"></a>
|
<img alt="Scrapling" src="assets/cover_light.svg" class="only-light">
|
||||||
|
<img alt="Scrapling" src="assets/cover_dark.svg" class="only-dark">
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
@@ -86,10 +91,34 @@ Scrapling’s GitHub stars have grown steadily since its release (see chart belo
|
|||||||
|
|
||||||
<div id="chartContainer">
|
<div id="chartContainer">
|
||||||
<a href="https://github.com/D4Vinci/Scrapling">
|
<a href="https://github.com/D4Vinci/Scrapling">
|
||||||
<img id="chartImage" alt="Star History Chart" loading="lazy" src="https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=date&legend=top-left&theme=dark" height="400"/>
|
<img id="chartImage" alt="Star History Chart" loading="lazy" src="https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date" height="400"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const observer = new MutationObserver((mutations) => {
|
||||||
|
mutations.forEach((mutation) => {
|
||||||
|
if (mutation.attributeName === 'data-md-color-media') {
|
||||||
|
const colorMedia = document.body.getAttribute('data-md-color-media');
|
||||||
|
const isDarkScheme = document.body.getAttribute('data-md-color-scheme') === 'slate';
|
||||||
|
const chartImg = document.querySelector('#chartImage');
|
||||||
|
const baseUrl = 'https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date';
|
||||||
|
|
||||||
|
if (colorMedia === '(prefers-color-scheme)' ? isDarkScheme : colorMedia.includes('dark')) {
|
||||||
|
chartImg.src = `${baseUrl}&theme=dark`;
|
||||||
|
} else {
|
||||||
|
chartImg.src = baseUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, {
|
||||||
|
attributes: true,
|
||||||
|
attributeFilter: ['data-md-color-media', 'data-md-color-scheme']
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Scrapling requires Python 3.10 or higher:
|
Scrapling requires Python 3.10 or higher:
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
> 💡 **Prerequisites:**
|
!!! success "Prerequisites"
|
||||||
>
|
|
||||||
> - You’ve completed or read the [Querying elements](../parsing/selection.md) page to understand how to find/extract elements from the [Selector](../parsing/main_classes.md#selector) object.
|
- You’ve completed or read the [Querying elements](../parsing/selection.md) page to understand how to find/extract elements from the [Selector](../parsing/main_classes.md#selector) object.
|
||||||
> <br><br>
|
|
||||||
|
|
||||||
After exploring the various ways to select elements with Scrapling and its related features, let's take a step back and examine the [Selector](#selector) class in general, as well as other objects, to gain a better understanding of the parsing engine.
|
After exploring the various ways to select elements with Scrapling and its related features, let's take a step back and examine the [Selector](#selector) class in general, as well as other objects, to gain a better understanding of the parsing engine.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user