Conditions | 2 |
Total Lines | 20 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
20 | @staticmethod |
||
21 | def sign(cookie): |
||
22 | url = ( |
||
23 | "https://www.right.com.cn/FORUM/home.php?mod=spacecp&ac=credit&showcredit=1" |
||
24 | ) |
||
25 | headers = { |
||
26 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " |
||
27 | "AppleWebKit/537.36 (KHTML, like Gecko) " |
||
28 | "Chrome/92.0.4515.131 Safari/537.36", |
||
29 | "Cookie": cookie, |
||
30 | } |
||
31 | session = requests.session() |
||
32 | response = session.get(url, headers=headers) |
||
33 | try: |
||
34 | coin = re.findall("恩山币: </em>(.*?)nb ", response.text)[0] |
||
35 | point = re.findall("<em>积分: </em>(.*?)<span", response.text)[0] |
||
36 | res = f"恩山币:{coin}\n积分:{point}" |
||
37 | except Exception as e: |
||
38 | res = str(e) |
||
39 | return res |
||
40 | |||
56 |