Skip to content

Instantly share code, notes, and snippets.

@mobeigi
Created December 7, 2020 12:11
Show Gist options
  • Save mobeigi/7c6bd81d32c5cc975e6f5ad055aed8f7 to your computer and use it in GitHub Desktop.
Save mobeigi/7c6bd81d32c5cc975e6f5ad055aed8f7 to your computer and use it in GitHub Desktop.
Cyberpunk 2077 GoG Game Price Scraper
import mechanicalsoup
import json
URL = 'https://menu.gog.com/v1/store/configuration?locale=en-US&currency=USD&country='
country_codes = ['AR','AU','AT','BS','BE','BO','BR','CA','CL','CN','CO','CR','HR','CU','CZ','DK','DO','EC','EG','SV','FI','FR','DE','GR','GT','HN','HK','IN','IE','IL','IT','JM','JP','LU','MX','MA','NL','NZ','NI','NG','NO','PY','PE','PL','PT','PR','RU','SA','ZA','ES','SE','CH','TW','TR','UK','US','UY','VE','SD','II','AF','AL','DZ','AO','AG','AW','AZ','BH','BD','BB','BY','BZ','BM','BT','BW','VG','BN','BG','BF','MM','BI','CM','CV','KY','KM','CG','CY','YE','DJ','DM','GQ','EE','FJ','GA','GM','GH','GD','GN','GW','GY','HT','HU','IS','ID','IR','CI','JO','KE','KW','KP','KG','LA','LV','LB','LR','LI','LT','MG','MY','ML','MT','MR','MN','MC','MZ','NP','AN','NE','OM','PK','PA','PH','QA','RO','KN','LC','VC','WS','SN','SG','SB','SZ','SY','TH','TT','TN','UA','AE','VN','YU','ZW','ZR','ET','KV','AX','AS','AD','AI','AQ','AM','BJ','BA','BV','IO','KH','CF','TD','CX','CC','CD','CK','ER','FK','FO','GF','PF','TF','GE','GI','GL','GP','GU','GG','HM','VA','IQ','IM','JE','KZ','KI','KR','LS','LY','MO','MK','MW','MV','MH','MQ','MU','YT','FM','MD','ME','MS','NA','NR','NC','NU','NF','MP','PW','PS','PG','PN','RE','RW','BL','SH','MF','PM','SM','ST','RS','SC','SL','SK','SI','SO','GS','SR','SJ','TJ','TZ','TL','TG','TK','TO','TM','TC','TV','UG','UM','UZ','VU','VI','WF','EH','ZM','LK']
browser = mechanicalsoup.StatefulBrowser()
browser.set_user_agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36')
for country_code in country_codes:
page = browser.get(URL + country_code)
if page.status_code != 200:
continue
price = page.json()["cyberpunk_list"]["products"][0]["price"]["amount"]
print(f'{country_code}: {price} USD')
@mobeigi
Copy link
Author

mobeigi commented Dec 7, 2020

AR: 49.99 USD
AU: 63.97 USD
AT: 70.14 USD
BS: 59.99 USD
BE: 70.14 USD
BO: 34.86 USD
BR: 34.86 USD
CA: 60.69 USD
CL: 34.86 USD
CN: 44.69 USD
CO: 34.86 USD
CR: 34.86 USD
HR: 70.14 USD
CU: 34.86 USD
CZ: 70.14 USD
DK: 69.09 USD
DO: 34.86 USD
EC: 34.86 USD
EG: 59.99 USD
SV: 34.86 USD
FI: 70.14 USD
FR: 70.14 USD
DE: 70.14 USD
GR: 70.14 USD
GT: 34.86 USD
HN: 34.86 USD
HK: 49.99 USD
IN: 42.99 USD
IE: 70.14 USD
IL: 59.99 USD
IT: 70.14 USD
JM: 59.99 USD
JP: 70.99 USD
LU: 70.14 USD
MX: 34.86 USD
MA: 59.99 USD
NL: 70.14 USD
NZ: 63.97 USD
NI: 34.86 USD
NG: 59.99 USD
NO: 61.25 USD
PY: 34.86 USD
PE: 34.86 USD
PL: 50.93 USD
PT: 70.14 USD
PR: 59.99 USD
RU: 25.06 USD
SA: 59.99 USD
ZA: 52.99 USD
ES: 70.14 USD
SE: 71.04 USD
CH: 76.46 USD
TW: 49.99 USD
TR: 41.99 USD
UK: 0.00 USD
US: 59.99 USD
UY: 44.99 USD
VE: 34.86 USD
SD: 59.99 USD
II: 0.00 USD
AF: 59.99 USD
AL: 59.99 USD
DZ: 59.99 USD
AO: 59.99 USD
AG: 59.99 USD
AW: 59.99 USD
AZ: 29.99 USD
BH: 59.99 USD
BD: 59.99 USD
BB: 59.99 USD
BY: 29.99 USD
BZ: 59.99 USD
BM: 59.99 USD
BT: 59.99 USD
BW: 59.99 USD
VG: 59.99 USD
BN: 59.99 USD
BG: 70.14 USD
BF: 59.99 USD
MM: 59.99 USD
BI: 59.99 USD
CM: 59.99 USD
CV: 59.99 USD
KY: 59.99 USD
KM: 59.99 USD
CG: 0.00 USD
CY: 70.14 USD
YE: 59.99 USD
DJ: 59.99 USD
DM: 59.99 USD
GQ: 59.99 USD
EE: 70.14 USD
FJ: 59.99 USD
GA: 59.99 USD
GM: 59.99 USD
GH: 59.99 USD
GD: 59.99 USD
GN: 59.99 USD
GW: 59.99 USD
GY: 59.99 USD
HT: 34.86 USD
HU: 70.14 USD
IS: 70.14 USD
ID: 48.99 USD
IR: 59.99 USD
CI: 59.99 USD
JO: 59.99 USD
KE: 59.99 USD
KW: 59.99 USD
KP: 59.99 USD
KG: 29.99 USD
LA: 59.99 USD
LV: 70.14 USD
LB: 59.99 USD
LR: 59.99 USD
LI: 70.14 USD
LT: 70.14 USD
MG: 59.99 USD
MY: 51.99 USD
ML: 59.99 USD
MT: 70.14 USD
MR: 59.99 USD
MN: 59.99 USD
MC: 70.14 USD
MZ: 59.99 USD
NP: 59.99 USD
AN: 59.99 USD
NE: 59.99 USD
OM: 59.99 USD
PK: 59.99 USD
PA: 34.86 USD
PH: 49.99 USD
QA: 59.99 USD
RO: 70.14 USD
KN: 59.99 USD
LC: 59.99 USD
VC: 59.99 USD
WS: 59.99 USD
SN: 59.99 USD
SG: 49.99 USD
SB: 59.99 USD
SZ: 59.99 USD
SY: 59.99 USD
TH: 56.99 USD
TT: 59.99 USD
TN: 59.99 USD
UA: 29.99 USD
AE: 59.99 USD
VN: 59.99 USD
YU: 0.00 USD
ZW: 59.99 USD
ZR: 0.00 USD
ET: 59.99 USD
KV: 0.00 USD
AX: 0.00 USD
AS: 59.99 USD
AD: 70.14 USD
AI: 59.99 USD
AQ: 0.00 USD
AM: 29.99 USD
BJ: 59.99 USD
BA: 59.99 USD
BV: 0.00 USD
IO: 59.99 USD
KH: 59.99 USD
CF: 59.99 USD
TD: 59.99 USD
CX: 59.99 USD
CC: 59.99 USD
CD: 59.99 USD
CK: 59.99 USD
ER: 59.99 USD
FK: 59.99 USD
FO: 59.99 USD
GF: 59.99 USD
PF: 59.99 USD
TF: 0.00 USD
GE: 59.99 USD
GI: 59.99 USD
GL: 59.99 USD
GP: 59.99 USD
GU: 59.99 USD
GG: 59.99 USD
HM: 0.00 USD
VA: 70.14 USD
IQ: 59.99 USD
IM: 59.99 USD
JE: 59.99 USD
KZ: 29.99 USD
KI: 59.99 USD
KR: 54.99 USD
LS: 59.99 USD
LY: 59.99 USD
MO: 59.99 USD
MK: 59.99 USD
MW: 59.99 USD
MV: 59.99 USD
MH: 59.99 USD
MQ: 59.99 USD
MU: 59.99 USD
YT: 59.99 USD
FM: 59.99 USD
MD: 29.99 USD
ME: 70.14 USD
MS: 59.99 USD
NA: 59.99 USD
NR: 59.99 USD
NC: 59.99 USD
NU: 59.99 USD
NF: 59.99 USD
MP: 59.99 USD
PW: 59.99 USD
PS: 59.99 USD
PG: 59.99 USD
PN: 59.99 USD
RE: 59.99 USD
RW: 59.99 USD
BL: 59.99 USD
SH: 59.99 USD
MF: 59.99 USD
PM: 59.99 USD
SM: 70.14 USD
ST: 59.99 USD
RS: 70.14 USD
SC: 59.99 USD
SL: 59.99 USD
SK: 70.14 USD
SI: 70.14 USD
SO: 59.99 USD
GS: 0.00 USD
SR: 59.99 USD
SJ: 0.00 USD
TJ: 29.99 USD
TZ: 59.99 USD
TL: 59.99 USD
TG: 59.99 USD
TK: 59.99 USD
TO: 59.99 USD
TM: 29.99 USD
TC: 59.99 USD
TV: 59.99 USD
UG: 59.99 USD
UM: 59.99 USD
UZ: 29.99 USD
VU: 59.99 USD
VI: 59.99 USD
WF: 59.99 USD
EH: 59.99 USD
ZM: 59.99 USD
LK: 59.99 USD

Russia is king 🇷🇺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment