-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrab_stores.py
36 lines (31 loc) · 1.12 KB
/
grab_stores.py
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
import requests
cookies = {
"_ga": "GA1.1.453840848.1707040973",
"_ga_D849FHQPDQ": "GS1.1.1707219294.2.1.1707219394.0.0.0",
}
headers = {
"authority": "pharmacystockchecker.com",
"accept": "*/*",
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
# Already added when you pass json=
# 'content-type': 'application/json',
# 'cookie': '_ga=GA1.1.453840848.1707040973; _ga_D849FHQPDQ=GS1.1.1707219294.2.1.1707219394.0.0.0',
"origin": "https://pharmacystockchecker.com",
"referer": "https://pharmacystockchecker.com/",
"sec-ch-ua": '"Not_A Brand";v="8", "Chromium";v="120"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Linux"',
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
}
json_data = "26"
response = requests.post(
"https://pharmacystockchecker.com/GetAllStockForItem",
cookies=cookies,
headers=headers,
json=json_data,
)
with open("outputs/stores.json", "w") as f:
f.write(response.text)