SinclairSchneider commited on
Commit
fbdf815
·
verified ·
1 Parent(s): bcfac17

Add detailed dataset card and the scraping pipeline used to build it

Browse files
Files changed (1) hide show
  1. README.md +31 -8
README.md CHANGED
@@ -282,7 +282,7 @@ Crawler settings used for this site:
282
 
283
  - **Worker processes:** 32 (`iNumberOfThreads = 32`)
284
  - **Retries per URL:** 10, with a 10-second socket timeout per attempt
285
- - **Proxy pool:** not used — the crawler connected directly
286
  - **User-agent rotation:** no, MechanicalSoup's default UA
287
  - **Politeness delay:** none — throttling was handled by the proxy pool / retry loop
288
  - **Bot-challenge handling:** none
@@ -341,17 +341,40 @@ pip install mechanicalsoup beautifulsoup4 lxml python-dateutil fake-useragent \
341
  mkdir br_de && cd br_de
342
  curl -L -O https://huggingface.co/datasets/SinclairSchneider/br_de/resolve/main/scraping/crawler.py
343
 
344
- # optional: route the crawl through your own forward proxies
345
- # export SCRAPER_PROXIES="proxy-a.example:3128,proxy-b.example:3128"
346
-
347
  python crawler.py # writes pages/*.json; `touch killall.txt` to stop
348
  jupyter notebook finalize.ipynb
349
  ```
350
 
351
- The original crawl used a pool of forward proxies on a private network. Those addresses are
352
- infrastructure-specific and have been **removed** from the published script; set
353
- `SCRAPER_PROXIES` to use your own pool, or leave it unset to connect directly. No credentials,
354
- cookies or personal data are contained in the published code.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
  **Please crawl responsibly:** respect `robots.txt` and the site's terms of use, keep the
357
  concurrency far below the 32 workers used here unless you have the site's permission, and prefer
 
282
 
283
  - **Worker processes:** 32 (`iNumberOfThreads = 32`)
284
  - **Retries per URL:** 10, with a 10-second socket timeout per attempt
285
+ - **Proxy pool:** not used — the original crawl connected directly (the published script can still route through proxies via `SCRAPER_PROXIES`, see below)
286
  - **User-agent rotation:** no, MechanicalSoup's default UA
287
  - **Politeness delay:** none — throttling was handled by the proxy pool / retry loop
288
  - **Bot-challenge handling:** none
 
341
  mkdir br_de && cd br_de
342
  curl -L -O https://huggingface.co/datasets/SinclairSchneider/br_de/resolve/main/scraping/crawler.py
343
 
 
 
 
344
  python crawler.py # writes pages/*.json; `touch killall.txt` to stop
345
  jupyter notebook finalize.ipynb
346
  ```
347
 
348
+ #### Routing the crawl through your own proxies
349
+
350
+ The original crawl ran behind a pool of forward proxies on a private network. Those addresses are
351
+ infrastructure-specific and have been **removed** from the published script. Instead, `crawler.py`
352
+ reads the `SCRAPER_PROXIES` environment variable: a comma-separated list of proxies, written with
353
+ or without a scheme (`http://` is assumed when none is given). One entry is picked per request, so
354
+ a pool spreads the load across several exits.
355
+
356
+ ```bash
357
+ # a single proxy
358
+ export SCRAPER_PROXIES="proxy-a.example.com:3128"
359
+
360
+ # a pool, rotated per request
361
+ export SCRAPER_PROXIES="proxy-a.example.com:3128,proxy-b.example.com:3128"
362
+
363
+ # with an explicit scheme and credentials
364
+ export SCRAPER_PROXIES="http://user:pass@proxy.example.com:3128"
365
+
366
+ # SOCKS, if PySocks is installed
367
+ export SCRAPER_PROXIES="socks5://localhost:9050"
368
+
369
+ # back to a direct connection — this is the default
370
+ unset SCRAPER_PROXIES
371
+
372
+ python crawler.py
373
+ ```
374
+
375
+ Internally this becomes `requests`' standard `{'http': …, 'https': …}` proxy mapping; with the
376
+ variable unset the mapping is empty and the crawler connects directly. No credentials, cookies or
377
+ personal data are contained in the published code.
378
 
379
  **Please crawl responsibly:** respect `robots.txt` and the site's terms of use, keep the
380
  concurrency far below the 32 workers used here unless you have the site's permission, and prefer