- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- ”’
- Created on 2015-6-12
- @author: xiaohanfei
- ”’
- import urllib.parse,urllib.request,http.cookiejar
- def GetUrlRequest(iUrl,iStrPostData):
- postdata=urllib.parse.urlencode(iStrPostData)
- postdata=postdata.encode(encoding=‘UTF8′)
- header = {‘User-Agent’:‘Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)’}
- req= urllib.request.Request(
- url = iUrl,
[……]阅读全文