diff --git a/zy-rpc/match.yuanrenxue.com/match/7 b/zy-rpc/match.yuanrenxue.com/match/7 new file mode 100644 index 0000000..c1f8e71 --- /dev/null +++ b/zy-rpc/match.yuanrenxue.com/match/7 @@ -0,0 +1,435 @@ +第七题 动态字体,随风漂移 - 猿人学
+ + + + + + + +

任务7:采集这5页中胜点列的数据,找出胜点最高的召唤师,将召唤师姓名填入答案中

如遇到字体加载不完全情况刷新即可

召唤师段位胜点等级常用英雄胜率

+ + + +
\ No newline at end of file diff --git a/猿人学第7题-字体反爬/font.ttf b/猿人学第7题-字体反爬/font.ttf new file mode 100644 index 0000000..4ba2ac2 Binary files /dev/null and b/猿人学第7题-字体反爬/font.ttf differ diff --git a/猿人学第7题-字体反爬/readme.md b/猿人学第7题-字体反爬/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/猿人学第7题-字体反爬/案例.py b/猿人学第7题-字体反爬/案例.py new file mode 100644 index 0000000..e384334 --- /dev/null +++ b/猿人学第7题-字体反爬/案例.py @@ -0,0 +1,45 @@ +from urllib.parse import urlparse +import requests +import time +import json +import base64 + + +class App(object): + + def __init__(self): + pass + + def get_html(self, m, page): + Headers = { + "user-agent": "yuanrenxue.project", + "cookie": m + } + url = f"https://match.yuanrenxue.com/api/match/7?page={page}" + print(url) + req = requests.get(url=url, headers=Headers) + return json.loads(req.text) + + def with_ttf(self, woff): + b64_code = woff + with open('font.ttf', 'wb') as f: + f.write(base64.decodebytes(b64_code.encode())) + + def run(self): + data_sum = 0 + for page in range(1, 6): + res = self.get_html("", page) + woff = res.get('woff') + self.with_ttf(woff) + data_list = res.get('data') + for data in data_list: + print(data.get('value')) + # data_sum += data.get('value') + time.sleep(1) + + print(data_sum) + + +if __name__ == '__main__': + app = App() + app.run()