马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 三一王 于 2021-1-10 09:35 编辑
源代码如下:
import urllib.parse
import requests
def url_open(url):
headers = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36'}
url_1 = {"event_name": "submitUser", "unit": "day", "from_date": "2021-01-02", "to_date": "2021-01-08",
"measure_type": "times", "rangeText": "过去 7 天", "sampling_factor": "64", "filter": {
"conditions": [{"field": "event.submitUser.OperationType", "function": "equal", "params": ["注册"]},
{"field": "event.submitUser.status", "function": "equal", "params": ["成功", "true"]}],
"relation": "and"}, "bookmarkid": "392", "slice_by_value": "2021-01-07", "slice_freq": "1",
"slice_max_freq": "", "detail": "true", "tracker_type": "分布分析", "num_per_page": 50, "limit": 1000,
"page": 0, "all_page": 'false',
"profiles": ["user.userId", "user.enterpriseName", "user.enterpriseIdentifier"],
"sort_by_field": "first_id", "asc": 'true', "use_cache": 'false'}
data = dict(url_1)
data = urllib.parse.urlencode(data).encode('utf-8')
response = requests.post(url,headers = headers,data = data,auth=('******', '******'))
html = response.text
return html
url = 'https://sensors-web.vandream.com/api/addictions/user/list'
print(url_open(url))
报错如下:
{"error":"没有访问权限,请检查 project 和 token"}
请问project和token在哪里,如何修改啊
另外,这个网站登录验证的时候用的是request payload,而且还不是常见的json格式。想要从头模拟下登录也不行
|