-
Notifications
You must be signed in to change notification settings - Fork 163
/
run.py
30 lines (25 loc) · 904 Bytes
/
run.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
import time
import execjs
import requests
def get_vector_data():
headers = {
'Host': 'www.shipxy.com',
'Referer': 'http://www.shipxy.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36'
}
data = {"scode": "417149",
"level": "11",
"area": "121106414,38873869,122424774,39083429",
"enc": "0",
"src": "0",
"_t": str(int(time.time() * 1000))
}
r = requests.get('http://www.shipxy.com/ship/getareashipssimple', params=data, headers=headers)
data = r.json()["data"]
with open('demix.js', 'r')as f:
content = f.read()
ctx = execjs.compile(content)
result = ctx.call('p', data, 1)
return result
if __name__ == '__main__':
print(get_vector_data())