1. urllib
https://docs.python.org/zh-cn/3/library/urllib.request.html#module-urllib.request
def post_request(url, data):
#req = urllib2.Request(url)
req = request.urlopen(url)
#post_data = urllib.urlencode(data)
post_data = parse.urlencode(data)
#opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
opener = request.urlopen(request.HTTPCookieProcessor())
response = opener.open(req, post_data)
resp = response.read()
if "Success to Merge Data!" in resp:
logging.info("success to upload and merge")
post_status = True
else:
logging.warning("failed to upload or merged")
post_status = False
return post_status
2. BeautifulSoup