import requests
import re
session = requests.Session() #实例化,维持会话
def token():
url_login = 'https://github.com/login'
response = session.get(url_login)
#通过正则获取token值
authenticity_token = re.findall('name=authenticity_token value=(.*?) />',response.text)[0]
return authentici