from http.server import HTTPServer, BaseHTTPRequestHandler
class Serv(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/':
self.path = '/captcha.html'
try:
file_to_open = open(self.path[1:]).read()
self.send_response(200)
except:
file_to_open = "File not found"
self.send_response(404)
self.end_headers()
self.wfile.write(bytes(file_to_open, 'utf-8'))
httpd = HTTPServer(('', 8080), Serv)
httpd.serve_forever()
我想查看客户端在解决验证码后收到的验证码令牌。验证码解决后,客户端会发送带有验证码信息的POST,并接收带有令牌的响应。我不太确定如何查看此令牌。我尝试使用请求,但是因为我的脚本不是发送POST的内容,所以找不到解决方案。