File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
zulip_bots/zulip_bots/bots/jarvis/lib/data Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 52
52
'upgrade-insecure-requests' :'1' ,
53
53
'user-agent' :'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36'
54
54
}
55
- headers_login = {
55
+ headers_login_agent = {
56
56
'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36'
57
57
}
58
58
@@ -64,11 +64,12 @@ def get_tcp(usr, pwd):
64
64
url = 'https://dashboard.cpolar.com/login'
65
65
66
66
params = f'login={ usr } &password={ pwd } ' #&csrf_token='+csrf_token
67
- res = session .post (url , headers = headers_login , data = params )
67
+ res = session .post (url , headers = headers_login_agent , data = params )
68
68
69
69
if res .status_code == 200 :
70
70
status_url = 'https://dashboard.cpolar.com/status'
71
- sources = requests .get (status_url , headers = headers_tcp )
71
+ # sources = requests.get(status_url, headers=headers_tcp)
72
+ sources = session .get (status_url , headers = headers_login_agent )
72
73
e = etree .HTML (sources .text )
73
74
item_list = e .xpath ("//tr/td/text()" )
74
75
item_num = len (item_list )// 4
You can’t perform that action at this time.
0 commit comments