随笔 - 265  文章 - 1  评论 - 3  阅读 - 12万

常用模块文档地址

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/

 

3.traceback

 https://docs.python.org/3/library/traceback.html

 

posted on   肉松蛋卷  阅读(134)  评论(0编辑  收藏  举报
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示