[Python] Frequently used method or solutions for issues

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Python] Frequently used method or solutions for issues相关的知识,希望对你有一定的参考价值。

  • 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的主要内容,如果未能解决你的问题,请参考以下文章

tmux frequently asked questions

Bytesctf2021 frequently详解

缓存算法

7.12 Models -- Frequently Asked Questions

工作笔记20170315-------关于FAQ(Frequently Asked Questions)列表的代码

Oracle Multitenant Option - 12c Frequently Asked Questions (文档 ID 1511619.1)译文