python3 urllib 访问https网站

来源:互联网 发布:门户源码 编辑:程序博客网 时间:2024/06/06 02:26

当使用urllib模块访问https网站时,由于需要提交表单,而python3默认是不提交表单的,所以这时只需在代码中加上以下代码即可。

import sslssl._create_default_https_context=ssl._create_unverified_context
原创粉丝点击