Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
86 lines (81 loc) · 4.39 KB
/
Copy path.env.example
File metadata and controls
86 lines (81 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# amazon-scraper — configuration
#
# Copy this file to `.env` next to the scripts and fill in what you need.
# Nothing here is required: with no .env and no environment variables at all
# the scrapers behave exactly as their flags say.
#
# Measured, so you know what the paid parts actually buy: an ordinary local
# Chromium on a clean residential IP returned 3 pages / 77 products from
# amazon.com with NO key, NO proxy and NO account — see the README. The
# products below buy volume from many addresses, a specific exit country, and
# a browser you do not have to run yourself.
#
# CREDENTIALS BELONG HERE AND NOWHERE ELSE. A secret on a command line is
# readable by anything on the machine that can run `ps`, and it lands in your
# shell history. Every flag these variables back can also be typed, and an
# explicit flag always wins over this file.
#
# Precedence, highest first:
# explicit flag -> exported environment variable -> .env -> default
#
# Run `python3 env_config.py` to see what was picked up. It prints which
# variables were found WITHOUT printing their values.
# ---------------------------------------------------------------------------
# 2Captcha — one key, four separately-billed products
# ---------------------------------------------------------------------------
# Captcha solving, the Scraping Browser API, proxies and fingerprints all
# authenticate with this one key and are billed separately.
#
# On Amazon the solving part is for ONE specific page: the first-party image
# captcha ("Enter the characters you see below"). It is NOT needed for the
# AWS WAF interstitial, which the browser clears by itself in about four
# seconds, and no solve helps a 503 throttle or a sign-in wall.
TWOCAPTCHA_KEY=your_2captcha_api_key_here
# ---------------------------------------------------------------------------
# Scraping Browser API (a remote browser over CDP)
# ---------------------------------------------------------------------------
# Endpoint shape:
# ws://{login}-zone-scraping_browser-country-{cc}-pid-{profileId}:{password}@cb.2captcha.com:9222
#
# `country-` picks the exit country. On Amazon that decides the page language
# AND the currency you are quoted — prices are converted for a visitor whose
# delivery country differs from the marketplace, so a European exit reading
# amazon.co.jp is shown "EUR 25.34" rather than yen. If you want a
# marketplace's own currency, use an exit in that country.
#
# `pid-` is a profile with persistent cookies and allows ONE live connection
# each, capped per account — reuse profile ids rather than minting one per
# run. Note the cookie persistence has a cost here: Amazon assigns some page
# variants per session, and a profile that was given the detail page without
# its reviews keeps getting it. A different `pid` is the fix.
#
# --concurrency is refused with this set, for the same one-connection reason.
AMAZON_CDP_ENDPOINT=
# ---------------------------------------------------------------------------
# Proxy
# ---------------------------------------------------------------------------
# One exit, as a full URL: http://ACCOUNT:PASSWORD@HOST:PORT
# For a pool, use --proxy-file with one URL per line.
#
# Ignored when AMAZON_CDP_ENDPOINT is set: the remote browser has its own
# exit, and layering a second on top contradicts it rather than helping.
#
# Note selenium_scraper.py cannot authenticate a proxy at all — chromedriver's
# --proxy-server takes no credentials. It strips them and warns. Use the
# Playwright or pyppeteer engine for an authenticated exit.
AMAZON_PROXY=
# ---------------------------------------------------------------------------
# Target
# ---------------------------------------------------------------------------
# The URL to scrape, so a scheduled run does not need it on the command line.
# The hostname decides which of the 21 marketplaces is read — there is no
# separate marketplace flag, so a flag and a URL cannot disagree.
#
# listing mode: https://www.amazon.com/s?k=wireless+headphones
# https://www.amazon.com/Best-Sellers-Electronics/zgbs/electronics/
# product mode: https://www.amazon.com/dp/B07K5214NZ
# reviews mode: https://www.amazon.com/dp/B07K5214NZ
AMAZON_URL=
# Deliberately NOT configurable here: the output prefix. `--out` already has a
# non-empty default, so the loader (which only fills UNSET values) would never
# apply a variable for it — a setting that looks configurable and is not.