首页 > 编程语言 > 详细

[Python] Frequently used method or solutions for issues

时间:2018-11-16 12:41:08      阅读:138      评论:0      收藏:0      [点我收藏+]
  • Web Scraping爬虫  for Mac urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>

            Solution:  if 1) does not work, then try to use 2).  Reference is here

        1) 

  pip install --upgrade certifi

        2)

open /Applications/Python\ 3.6/Install\ Certificates.command

 

  • Remove leading whitespace 去除string前面的空格

    Solution:

>>>      hello world!.lstrip()
hello world!

 

  • Web Scraping爬虫
    看网页编码方式( 一般为“utf-8”)

    SolutionF12功能键,即可使用开发者工具,在窗口console标签下,键入 "document.charset" 即可查看网页的编码方式

 

[Python] Frequently used method or solutions for issues

原文:https://www.cnblogs.com/Johnsonxiong/p/9968560.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!