快速计算
#encoding: utf-8
import requests
import re
url="http://"
s=requests.session()
r=s.get(url)
res=r.content
#print(r.text)
a=res.find("<b>")
b=res.find("</b>",a) #从a开始,找到"</b>"
num=res[a+5:b-1] #截取算式
#print(num)
#num=num.replace(" ","")
#num=num.replace("x","*")
num=eval(num) #计算
payload = {
'answer':num, #F12 -> Network -> Form Data
'submits':"提交"
}
r=s.post(url,data=payload)
print(r.text)
print(num)