常用模块文档地址
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
https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/
https://docs.python.org/3/library/traceback.html
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步