Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

docs: fix website main page image and add automatic stars update again

Karim shoair9b042d0c0a6d
diff --git a/docs/assets/star-history.png b/docs/assets/star-history.png
deleted file mode 100644
index 2125255..0000000
Binary files a/docs/assets/star-history.png and /dev/null differ
diff --git a/docs/index.md b/docs/index.md
index 6fd7320..4818a01 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -19,9 +19,7 @@ description: "Scrapling - Effortless Web Scraping for the Modern Web!"
</a>
</div>
-# Scrapling: Python Web Scraping
-
-<p align="center"><i>Effortless Web Scraping for the Modern Web!</i></p>
+<h2 align="center"><i>Effortless Web Scraping for the Modern Web</i></h2><br>
Scrapling is a Python Web Scraping framework that brings fast HTTP requests, stealth browsers, powerful parsing, and concurrent crawling into one library.
@@ -179,12 +177,36 @@ This prints `10` and saves the quotes and authors to `quotes.json`.
## Star History
Scrapling’s GitHub stars have grown steadily since its release (see chart below).
-<div>
- <a href="https://www.star-history.com/?repos=D4vinci%2FScrapling&type=date&legend=top-left">
- <img alt="Star History Chart" loading="lazy" src="assets/star-history.png" style="height: 400px;"/>
+<div id="chartContainer">
+ <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" height="400"/>
</a>
</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
Scrapling requires Python 3.10 or higher: