import requests_html
import json
class UrlPostGet:
def __init__(self):
self.post_url = ''
self.get_url = ''
self.post_get = requests_html.HTMLSession()
def post(self, ua, data):
r = json.loads(self.post_get.post(self.post_url, data=data, headers=ua).text)
return r
def get(self, ua, data):
r = self.post_get.get(self.get_url, data=data, headers=ua)
return r
python的requests_html的基础操作
最新推荐文章于 2024-08-13 15:47:49 发布