urlopen
我们先阅读以下代码:
#!/usr/bin/python3 # -*- conding:utf-8 -*- __author__ = 'mayi' # 导入urllib.request库 import urllib.request # 向指定的url发送请求,并返回服务器响应的类文件对象 response = urllib.request.urlopen("http://HdhCmsTestbaidu测试数据/") # 类文件对象支持 文件对象的操作方法,如read()方法读取文件全部内容,返回字符串 html = response.read() # 打印字符串 print(html)
查看更多关于urllib.request库的使用基础的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84679