爬虫:使用Requests模块基本使用_response=requests.port(-程序员宅基地

技术标签: 爬虫  request  python  urllib  爬虫【python】  

 

目录

安装Requests

示例引入

GET请求

抓取网页

抓取二进制数据

 POST请求

常用的响应

我们了解urllib的基本用法,但是其中确实有不方便的地方,比如处理网页验证和 ookies时,需要写 Opener 和Handler来处理.。为了更加方便地实现这些操作,就有了更为强大的库request ,有了它, Cookies 、登录验证、代理设置等操作都不是事儿。

安装Requests

pin install requests

示例引入

import requests

response = requests.get("https://www.baidu.com")
print(type(response))
print(response.status_code)
print(type(response.text))
print(response.text)
print(response.cookies)

结果
<class 'requests.models.Response'>
200
<class 'str'>
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge> </div> </div> </div> </body> </html>

<RequestsCookieJar[<Cookie BDORZ=27315 for .baidu.com/>]>

这里我们调用 get() 方法实现与 urlopen() 相同的操作,得到一个 Response 对象,然后分别输出 Response 的类型、状态码、响应体的类型、以及内容 及Cookies

通过运行结果可以发现,它的返回类型是 requests.models .Response 响应体的类型是字符串str, Cookies 的类型是Req uestsCookieJar

GET请求

HTTP中最常见的请求之一就GET是请求,下面首先来详细了解一下利用 Requests 构建 GET 请求的方法
 

import requests

data = {
    "age":22,
    "name":"python"
}

reponse = requests.get("http://192.168.1.104/get",params=data)
print(type(reponse.text))
print(reponse.json())
print(type(reponse.json()))

结果:
<class 'str'>
{'args': {'age': '22', 'name': 'python'}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'Host': '192.168.1.104', 'User-Agent': 'python-requests/2.25.1'}, 'origin': '192.168.1.101', 'url': 'http://192.168.1.104/get?age=22&name=python'}
<class 'dict'>

可以发现调用json()方法,就可以将返回结果是JSON格式的字符串转化为字典,但需要注意的是,如果返回结果不是 JSON 式,便会出现解析错误,抛出 json.decoder. JSONDecodeError 异常

抓取网页

上面的请求链接返回的是 JSON 形式的字符串, 那么如果请求普通的网页,则肯定能获得相应的内容了

import requests
import re

headers = {
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
}
reponse = requests.get("https://www.zhihu.com/explore",headers=headers)
pattern = re.compile('"ExploreSpecialCard-contentTitle".*?.data-za-detail-view-id="5794"*?>(.*?)</a>',re.S)
title = re.findall(pattern,reponse.text)
print(title)


结果:
['提示一:成为风险管理者', '时间旅人:上知乎的穿越者能透露一点未来的事吗?', '「保险」到底保险吗?', '【答案年终秀】本届天团向知乎网友问好', '你认为中国青年准备好走向世界舞台中央了吗?', '如何评价现在的大学生?', '哪些细思极恐的行为会让你感染HPV?', '哪些细思极恐的行为会让你感染HPV?', '接种 hpv 疫苗时,有哪些注意事项?', '长寿时代,不少人成了「困在长寿里的人」,该如何破局?', '健康问题让你对生活做出了哪些妥协?', '如何拥有一个充实而又愉快的老年生活?']

这样就可以提取其中的文本信息了

抓取二进制数据

在上面的例子中,我们抓取的是知乎的一个页面 实际上它返回的是 HTML 文档 如果想抓取图片、音频、 视频等文件,应该怎么办呢?

图片、音频、视频这些文件本质上都是由二进制码组成的,由于有特定的保存格式和对应的解析方式, 我们才可以看到这些形形色色的多媒体 所以,想要抓取它们,就要拿到它们的二进制码

import requests


headers = {
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
}
reponse = requests.get("https://static.zhihu.com/heifetz/favicon.ico",headers=headers)
print(reponse.text)
print(reponse.content)

结果;
           ¨     (       @                                     �e `�g Ώ�e ώ�f ��f ��f��f ��f ��f ��f ��f ��f ��f ��f ��fώ�f��f��e ��f ��fώ�g ώ�j��k ��lξ�o Ώ�q _                �` �f Ο�e ώ�f ��f ��e ώ�f ��f ��f ��f ��fώ�eώ�f��e ��fώ�f��f ��f ��f��f ��g��h ��i ��k ��l ��n ��p ��q ώ�t Ώ�p         �eΏ�eώ�f ��f ��f��f ��f ��f ��f ��f ��f ��f ��f ��g��f ��fώ�f ��f ��f ��g ��h ώ�j ��l ��lώ�n ��p ��r ��s ��u ��w Ο    �f _�f ��f ��fώ�f ��f ��f��f ��e ώ�f��fώ�e ώ�f ��eώ�e ώ�fώ�eώ�f ��f��g ��i ��j ��l ��n ��o ��p ��qώ�t ��u ��v ��x��y _�g Ώ�e ��f��f ��f ��f ��f ��f ��e ώ�e ώ�f ��f ��f��f ��f ��f ��f��g��g ��i ��k ��l ��n��oώ�p ώ�r��s ��u ώ�v ��x ��y ώ�{ Ώ�fξ�f��f ��e ώ�f���@���`���@��f ��e ώ�eώ�f��f ��e ώ�f ��e ώ�fώ�h ��i ��k ��lώ�m ώ�o ��qώ�s ��sώ�u ώ�v ��y ��z ��{ώ�}��f ��fώ�e ��f ��e ώ� `��υο������ΨΏ��y ώ�f ��f ��f��e ώ�f��Ε ��h ��j��k ��lώ�Ι ��”@��q ��s ��t ��v��w ��x ώ�z ��{ ��}ώ� ��e ώ�f��f ��f ��f ��f ��‚0��υο������μί��f ��fώ�e ώ�f ��p������s��l ��m ��n ��φο������Β���}��uώ�x ��y ��z ώ�|��}ώ�€��€ ��f ��f ώ�f ��f ��f ��f ��f ���`����������³€ώ�eώ�f ��z!��υο������~ ��¤`��������������������������������������| ώ�~��€ ��€ ώ�‚ ώ�e ώ�f ��f��f��e ��f��fώ�f ��Ε ������μί��y ��g ��ΩΏ������ΪΏ��m��¥`��������������—@��Υ―������������������~ ��€��€ώ�‚ ώ�„��f ��f ��f ��f ��f ��f ��f��fώ�x!ώ���������΅`��¬pώ�����φο��€ ώ�o ώ�¦`������άΏ��u ��vώ�x ��z ��‹ ����������€ ���ώ�‚ώ�„ ��… ��f ��f ��e ώ�f��g��f ��eώ�f ��f ��Ζ ������ΪΏ��μί������p��p ��q ��§`������έΏ��w ώ�y ��yώ�| ���!ώ���������‚ ��ƒ ��… ��† ��� ��fώ�f ��f ��f ��f ��f��e ώ�f ��g ���@ώ�����φο�� ��ΐ���p ��qώ�s ��¨`������ήΏ��y ��z ώ�|��~��� ����������ƒ ��… ��‡�����‰ ��fώ�f ��f ��f ��f��f ��f ��f ώ�hώ�j ��φο������‰1ώ�p��q ��s ��tώ�`������ήΏ��{��}��} ώ� ��‘!ώ���������…��‡���ώ�� ���ώ�f��fώ�fώ�f ��f��p��z!ώ�{ ώ�} ��~ ��δΟ�������P��qώ�s ��u ��v ��«aώ�����ήΏ��} ��~ �� ��€ώ�’ ����������‡ ��‰��‰ ώ�‹ ώ��ώ�f ��f��fώ�f ��fώ�½�������������������������������������������ξί��­`ώ�����ίΏ��~��€ώ�� ��ƒ ��” ����������‰������������ ��f ��f��fώ�f ��h ��| ��ΪΏ��μί��νί��νί��φο������χο��ξί��ξί��οί��Ξ���­`������ίΏ��€��� ��ƒ ��„ ώ�• ����������‹��� ������ ��‘ ώ�f��f ��g ��i ��i ��k ��m��n ώ�p ��q ��Ή€������Λ���w ��y��z ώ�{ ��`������ΰΏ��‚ ��ƒώ�… ��†ώ�—!ώ���������� ώ�� ��� ��‘ ��“ώ�f ��g ��i��j ��l ��m ��o ��p ��r ��s ��Ή€������Μ���y ��{��| ��~ ��―`������ΰΏ��„ ��… ��‡ ��‡ώ�� ����������� ��� ώ�‘��“ώ�” ��g ��i��jώ�lώ�m ��›P��―pώ�zώ�t��u ��Ί€������Ν���{ ��|ώ�~ ��€ ��°a������ΰΏ��… ��‡ ώ�� ���ώ�� ����������� ��’ ��“ ��” ��— ώ�i ��j ��l ��m ��o ��”@������ξί��‡ ��w��Ό€������Ξ���| ��~ ��€ ��� ��±`������ΰΏ�����‰ ��� �����› ����������’��“��• ��—ώ�� ��j ώ�m��n��p��q ��r ��άΏ������Γ���xώ�Ό€������Ο���~ ��€��� ��ƒώ�²`������αΏ��‰��� ��� ��� ��� ����������”��• ��—ώ�� ��� ��lώ�nώ�p ��q ��s ��t ώ�`������χο��ήΏ��οί������χο��ίΏ��ίΏ��ίΏ��³`��³a������χο��αΏ��γΏ��γΏ��γΏ��γΏ����������• ��— ώ�� ��� ��› ��n ��p ��q ��s ώ�u ��v ��� ��������������������������������������΄`��΄`��������������������������������������� ώ���� ��� �����q ��qώ�s ��u ��v ��x ��yώ�Φ―������Η��� @ώ�΅@��΅@��£@ώ�¤@��¥@��‰��‘��@���@��«@��¬@��­@��@��―@��°@��²@�� ��› ώ����� ώ�� ��r ��t��u ��v ��xώ�y ώ�{��­`������ηΟ��� ��‚ ��…��†��‡ ώ�‰ ��� ώ�� ��� ��� ��� ��’ώ�“ ��–ώ�– ��� ��� ώ�› ������ ώ�� ��΅ ��t ��u��w ��x ��z��{ ��} �� ��·p��χο��“ ώ�„ ��… ��‡ ��� ώ�‹ ������ ��� ��‘��’��” ��• ��—ώ��ώ�� ��›������ ��  ώ�΅ ��£ ο�wΏ�w ��y ��zώ�{ ��} �� ��€ ��‚��„ ��… ��† ώ�‡ώ�‰ ��‹ώ�� ���ώ�� ��‘ώ�“ ��•ώ�• ��— ��� ��� ������ �����  ��Ά��£��¤ Ώ�x `�y��z ��|��~��€ ��€ ��‚��ƒ ��… ώ�†��� ��� ��‹��� ��� ��� ��‘ ��“ ��• ��–ώ�— �� ��› ώ��ώ����� ��  ��Ά��£ ��¥ ��¦ _    �zΟ�| ��~ώ�€��� ��‚��ƒώ�†��† ώ��ώ��ώ�‹ώ�� ��� ώ�� ώ�‘ ��“ ώ�• ��— ώ�— �� ��� ��� ���ώ�� ��΅ ��Ά��¤ώ�¥ ��§ Ώ        �€ �} Ώ�€ώ�� ��ƒ ��„ώ�… ��‡��‰��� ��‹ ���ώ�� ��� ��’ώ�” ώ�” ��– ��� �� ��› ��� ��� �����΅��Ά��£ ��¥ ��§ Ο��                 �� _�ƒ Ώ�„ ο�… ώ�‡ ��‰ώ�� ��� ��� ���ώ�� ��’��”��• ��— ��� ���ώ�› ���ώ�� ��� ��΅ ��£��¤ ��¥ Ώ�¦ _            ΰ  €  €                                                                                                          €  €  ΰ  
b'\x00\x00\x01\x00\x01\x00  \x00\x00\x01\x00 \x00\xa8\x10\x00\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\x00\x01\x00 \x00\x00\x00\x00\x00\x00\x10\x00\x00\x13\x0b\x00\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xffe\x00`\xffg\x00\xbf\xffe\x00\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xfe\xfff\x01\xff\xfff\x01\xff\xffe\x00\xff\xfff\x00\xff\xfff\x01\xfe\xffg\x00\xfe\xffj\x01\xff\xffk\x00\xff\xffl\x01\xee\xffo\x00\xbf\xffq\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff`\x00\x10\xfff\x00\xcf\xffe\x00\xfe\xfff\x00\xff\xfff\x00\xff\xffe\x00\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xfe\xffe\x01\xfe\xfff\x01\xff\xffe\x00\xff\xfff\x01\xfe\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xffg\x01\xff\xffh\x00\xff\xffi\x00\xff\xffk\x00\xff\xffl\x00\xff\xffn\x00\xff\xffp\x00\xff\xffq\x00\xfe\xfft\x00\xbf\xffp\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\xffe\x01\xbf\xffe\x01\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xffg\x01\xff\xfff\x00\xff\xfff\x01\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xffg\x00\xff\xffh\x00\xfe\xffj\x00\xff\xffl\x00\xff\xffl\x01\xfe\xffn\x00\xff\xffp\x00\xff\xffr\x00\xff\xffs\x00\xff\xffu\x00\xff\xffw\x00\xcf\x00\x00\x00\x00\xfff\x00_\xfff\x00\xff\xfff\x00\xff\xfff\x01\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xffe\x00\xfe\xfff\x01\xff\xfff\x01\xfe\xffe\x00\xfe\xfff\x00\xff\xffe\x01\xfe\xffe\x00\xfe\xfff\x01\xfe\xffe\x01\xfe\xfff\x00\xff\xfff\x01\xff\xffg\x00\xff\xffi\x00\xff\xffj\x00\xff\xffl\x00\xff\xffn\x00\xff\xffo\x00\xff\xffp\x00\xff\xffq\x01\xfe\xfft\x00\xff\xffu\x00\xff\xffv\x00\xff\xffx\x01\xff\xffy\x00_\xffg\x00\xbf\xffe\x00\xff\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xffe\x00\xfe\xffe\x00\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xffg\x01\xff\xffg\x00\xff\xffi\x00\xff\xffk\x00\xff\xffl\x00\xff\xffn\x01\xff\xffo\x01\xfe\xffp\x00\xfe\xffr\x01\xff\xffs\x00\xff\xffu\x00\xfe\xffv\x00\xff\xffx\x00\xff\xffy\x00\xfe\xff{\x00\xbf\xfff\x01\xee\xfff\x01\xff\xfff\x00\xff\xffe\x00\xfe\xfff\x01\xff\xff\x8d@\xff\xff\x9f`\xff\xff\x8c@\xff\xfff\x00\xff\xffe\x00\xfe\xffe\x01\xfe\xfff\x01\xff\xfff\x00\xff\xffe\x00\xfe\xfff\x00\xff\xffe\x00\xfe\xfff\x01\xfe\xffh\x00\xff\xffi\x00\xff\xffk\x00\xff\xffl\x01\xfe\xffm\x00\xfe\xffo\x00\xff\xffq\x01\xfe\xffs\x00\xff\xffs\x01\xfe\xffu\x00\xfe\xffv\x00\xff\xffy\x00\xff\xffz\x00\xff\xff{\x01\xfe\xff}\x01\xff\xfff\x00\xff\xfff\x01\xfe\xffe\x00\xff\xfff\x00\xff\xffe\x00\xfe\xff\xa0`\xff\xff\xf5\xef\xff\xff\xff\xff\xff\xff\xd8\xbf\xff\xffy \xfe\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xffe\x00\xfe\xfff\x01\xff\xff\xc5\xa0\xff\xffh\x00\xff\xffj\x01\xff\xffk\x00\xff\xffl\x01\xfe\xff\xc9\xa0\xff\xff\x94@\xff\xffq\x00\xff\xffs\x00\xff\xfft\x00\xff\xffv\x01\xff\xffw\x00\xff\xffx\x00\xfe\xffz\x00\xff\xff{\x00\xff\xff}\x01\xfe\xff\x7f\x00\xff\xffe\x00\xfe\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xff\x820\xff\xff\xf5\xef\xff\xff\xff\xff\xff\xff\xec\xdf\xff\xfff\x00\xff\xfff\x01\xfe\xffe\x00\xfe\xfff\x00\xff\xff\xa9p\xff\xff\xff\xff\xff\xffs\x10\xff\xffl\x00\xff\xffm\x00\xff\xffn\x00\xff\xff\xf6\xef\xff\xff\xff\xff\xff\xff\xc2\x90\xff\xff}\x11\xff\xffu\x01\xfe\xffx\x00\xff\xffy\x00\xff\xffz\x00\xfe\xff|\x01\xff\xff}\x01\xfe\xff\x80\x01\xff\xff\x80\x00\xff\xfff\x00\xff\xfff\x00\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xff\x9f`\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb3\x80\xfe\xffe\x01\xfe\xfff\x00\xff\xffz!\xff\xff\xf5\xef\xff\xff\xff\xff\xff\xff~ \xff\xff\xa4`\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff|\x00\xfe\xff~\x01\xff\xff\x80\x00\xff\xff\x80\x00\xfe\xff\x82\x00\xfe\xffe\x00\xfe\xfff\x00\xff\xfff\x01\xff\xfff\x01\xff\xffe\x00\xff\xfff\x01\xff\xfff\x01\xfe\xfff\x00\xff\xff\xc5\xa0\xff\xff\xff\xff\xff\xff\xec\xdf\xff\xffy \xff\xffg\x00\xff\xff\xd9\xbf\xff\xff\xff\xff\xff\xff\xda\xbf\xff\xffm\x01\xff\xff\xa5`\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x97@\xff\xff\xd5\xaf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x00\xff\xff\x80\x01\xff\xff\x80\x01\xfe\xff\x82\x00\xfe\xff\x84\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x01\xfe\xffx!\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xa1`\xff\xff\xacp\xfe\xff\xff\xff\xff\xff\xf6\xef\xff\xff\x80 \xfe\xffo\x00\xfe\xff\xa6`\xff\xff\xff\xff\xff\xff\xdc\xbf\xff\xffu\x00\xff\xffv\x01\xfe\xffx\x00\xff\xffz\x00\xff\xff\x8b \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\xff\xff\x81\x01\xfe\xff\x82\x01\xfe\xff\x84\x00\xff\xff\x85\x00\xff\xfff\x00\xff\xfff\x00\xff\xffe\x00\xfe\xfff\x01\xff\xffg\x01\xff\xfff\x00\xff\xffe\x01\xfe\xfff\x00\xff\xfff\x00\xff\xff\xc6\xa0\xff\xff\xff\xff\xff\xff\xda\xbf\xff\xff\xec\xdf\xff\xff\xff\xff\xff\xff\xaep\xff\xffp\x00\xff\xffq\x00\xff\xff\xa7`\xff\xff\xff\xff\xff\xff\xdd\xbf\xff\xffw\x00\xfe\xffy\x00\xff\xffy\x01\xfe\xff|\x00\xff\xff\x8d!\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x00\xff\xff\x83\x00\xff\xff\x85\x00\xff\xff\x86\x00\xff\xff\x88\x00\xff\xfff\x01\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xffe\x00\xfe\xfff\x00\xff\xffg\x00\xff\xff\x8e@\xfe\xff\xff\xff\xff\xff\xf6\xef\xff\xff\x7f \xff\xff\xc0\x90\xff\xffp\x00\xff\xffq\x01\xfe\xffs\x00\xff\xff\xa8`\xff\xff\xff\xff\xff\xff\xde\xbf\xff\xffy\x00\xff\xffz\x00\xfe\xff|\x01\xff\xff~\x01\xff\xff\x8f \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x00\xff\xff\x85\x00\xff\xff\x87\x01\xff\xff\x88\x01\xff\xff\x89\x00\xff\xfff\x01\xfe\xfff\x00\xff\xfff\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x00\xff\xfff\x00\xff\xfff\x00\xfe\xffh\x01\xfe\xffj\x00\xff\xff\xf6\xef\xff\xff\xff\xff\xff\xff\x891\xfe\xffp\x01\xff\xffq\x00\xff\xffs\x00\xff\xfft\x01\xfe\xff\xa9`\xff\xff\xff\xff\xff\xff\xde\xbf\xff\xff{\x01\xff\xff}\x01\xff\xff}\x00\xfe\xff\x7f\x00\xff\xff\x91!\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\x85\x01\xff\xff\x87\x01\xff\xff\x88\x01\xfe\xff\x8a\x00\xff\xff\x8a\x01\xfe\xfff\x01\xff\xfff\x01\xfe\xfff\x01\xfe\xfff\x00\xff\xfff\x01\xff\xffp\x10\xff\xffz!\xfe\xff{ \xfe\xff} \xff\xff~ \xff\xff\xe4\xcf\xff\xff\xff\xff\xff\xff\x9dP\xff\xffq\x01\xfe\xffs\x00\xff\xffu\x00\xff\xffv\x00\xff\xff\xaba\xfe\xff\xff\xff\xff\xff\xde\xbf\xff\xff}\x00\xff\xff~\x00\xff\xff\x7f\x00\xff\xff\x80\x01\xfe\xff\x92 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x87\x00\xff\xff\x89\x01\xff\xff\x89\x00\xfe\xff\x8b\x00\xfe\xff\x8d\x01\xfe\xfff\x00\xff\xfff\x01\xff\xfff\x01\xfe\xfff\x00\xff\xfff\x01\xfe\xff\xbd\x90\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xee\xdf\xff\xff\xad`\xfe\xff\xff\xff\xff\xff\xdf\xbf\xff\xff~\x01\xff\xff\x80\x01\xfe\xff\x81\x00\xff\xff\x83\x00\xff\xff\x94 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x89\x01\xff\xff\x8a\x01\xff\xff\x8c\x01\xff\xff\x8e\x01\xff\xff\x8f\x00\xff\xfff\x00\xff\xfff\x01\xff\xfff\x01\xfe\xfff\x00\xff\xffh\x00\xff\xff| \xff\xff\xda\xbf\xff\xff\xec\xdf\xff\xff\xed\xdf\xff\xff\xed\xdf\xff\xff\xf6\xef\xff\xff\xff\xff\xff\xff\xf7\xef\xff\xff\xee\xdf\xff\xff\xee\xdf\xff\xff\xef\xdf\xff\xff\xce\x9f\xff\xff\xad`\xff\xff\xff\xff\xff\xff\xdf\xbf\xff\xff\x80\x01\xff\xff\x81\x00\xff\xff\x83\x00\xff\xff\x84\x00\xfe\xff\x95 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8b\x01\xff\xff\x8c\x00\xff\xff\x8e\x01\xff\xff\x8f\x00\xff\xff\x91\x00\xfe\xfff\x01\xff\xfff\x00\xff\xffg\x00\xff\xffi\x00\xff\xffi\x00\xff\xffk\x00\xff\xffm\x01\xff\xffn\x00\xfe\xffp\x00\xff\xffq\x00\xff\xff\xb9\x80\xff\xff\xff\xff\xff\xff\xcb\x9f\xff\xffw\x00\xff\xffy\x01\xff\xffz\x00\xfe\xff{\x00\xff\xff\xae`\xff\xff\xff\xff\xff\xff\xe0\xbf\xff\xff\x82\x00\xff\xff\x83\x01\xfe\xff\x85\x00\xff\xff\x86\x01\xfe\xff\x97!\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8c\x00\xfe\xff\x8e\x00\xff\xff\x8f\x00\xff\xff\x91\x00\xff\xff\x93\x01\xfe\xfff\x00\xff\xffg\x00\xff\xffi\x01\xff\xffj\x00\xff\xffl\x00\xff\xffm\x00\xff\xffo\x00\xff\xffp\x00\xff\xffr\x00\xff\xffs\x00\xff\xff\xb9\x80\xff\xff\xff\xff\xff\xff\xcc\x9f\xff\xffy\x00\xff\xff{\x01\xff\xff|\x00\xff\xff~\x00\xff\xff\xaf`\xff\xff\xff\xff\xff\xff\xe0\xbf\xff\xff\x84\x00\xff\xff\x85\x00\xff\xff\x87\x00\xff\xff\x87\x01\xfe\xff\x98 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x00\xff\xff\x90\x00\xfe\xff\x91\x01\xff\xff\x93\x01\xfe\xff\x94\x00\xff\xffg\x00\xff\xffi\x01\xff\xffj\x01\xfe\xffl\x01\xfe\xffm\x00\xff\xff\x9bP\xff\xff\xafp\xfe\xffz\x11\xfe\xfft\x01\xff\xffu\x00\xff\xff\xba\x80\xff\xff\xff\xff\xff\xff\xcd\x9f\xff\xff{\x00\xff\xff|\x01\xfe\xff~\x00\xff\xff\x80\x00\xff\xff\xb0a\xff\xff\xff\xff\xff\xff\xe0\xbf\xff\xff\x85\x00\xff\xff\x87\x00\xfe\xff\x88\x00\xff\xff\x8a\x01\xfe\xff\x9a \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x90\x00\xff\xff\x92\x00\xff\xff\x93\x00\xff\xff\x94\x00\xff\xff\x97\x00\xfe\xffi\x00\xff\xffj\x00\xff\xffl\x00\xff\xffm\x00\xff\xffo\x00\xff\xff\x94@\xff\xff\xff\xff\xff\xff\xee\xdf\xff\xff\x87 \xff\xffw\x01\xff\xff\xbc\x80\xff\xff\xff\xff\xff\xff\xce\x9f\xff\xff|\x00\xff\xff~\x00\xff\xff\x80\x00\xff\xff\x81\x00\xff\xff\xb1`\xff\xff\xff\xff\xff\xff\xe0\xbf\xff\xff\x88\x01\xff\xff\x89\x00\xff\xff\x8a\x00\xff\xff\x8c\x01\xff\xff\x9b \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x92\x01\xff\xff\x93\x01\xff\xff\x95\x00\xff\xff\x97\x01\xfe\xff\x98\x00\xff\xffj\x00\xfe\xffm\x01\xff\xffn\x01\xff\xffp\x01\xff\xffq\x00\xff\xffr\x00\xff\xff\xdc\xbf\xff\xff\xff\xff\xff\xff\xc3\x90\xff\xffx\x01\xfe\xff\xbc\x80\xff\xff\xff\xff\xff\xff\xcf\x9f\xff\xff~\x00\xff\xff\x80\x01\xff\xff\x81\x00\xff\xff\x83\x01\xfe\xff\xb2`\xff\xff\xff\xff\xff\xff\xe1\xbf\xff\xff\x89\x01\xff\xff\x8a\x00\xff\xff\x8c\x00\xff\xff\x8e\x00\xff\xff\x9d \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x94\x01\xff\xff\x95\x00\xff\xff\x97\x01\xfe\xff\x98\x00\xff\xff\x9a\x00\xff\xffl\x01\xfe\xffn\x01\xfe\xffp\x00\xff\xffq\x00\xff\xffs\x00\xff\xfft\x00\xfe\xff\xa9`\xff\xff\xff\xff\xff\xff\xf7\xef\xff\xff\xde\xbf\xff\xff\xef\xdf\xff\xff\xff\xff\xff\xff\xf7\xef\xff\xff\xdf\xbf\xff\xff\xdf\xbf\xff\xff\xdf\xbf\xff\xff\xb3`\xff\xff\xb3a\xff\xff\xff\xff\xff\xff\xf7\xef\xff\xff\xe1\xbf\xff\xff\xe3\xbf\xff\xff\xe3\xbf\xff\xff\xe3\xbf\xff\xff\xe3\xbf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x95\x00\xff\xff\x97\x00\xfe\xff\x98\x00\xff\xff\x9a\x00\xff\xff\x9b\x00\xff\xffn\x00\xff\xffp\x00\xff\xffq\x00\xff\xffs\x00\xfe\xffu\x00\xff\xffv\x00\xff\xff\x88 \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb4`\xff\xff\xb4`\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x98\x00\xfe\xff\x99\x01\xff\xff\x9a\x00\xff\xff\x9c\x00\xff\xff\x9e\x01\xff\xffq\x00\xff\xffq\x01\xfe\xffs\x00\xff\xffu\x00\xff\xffv\x00\xff\xffx\x00\xff\xffy\x01\xfe\xff\xd6\xaf\xff\xff\xff\xff\xff\xff\xc7\x90\xff\xff\xa0@\xfe\xff\xa1@\xff\xff\xa1@\xff\xff\xa3@\xfe\xff\xa4@\xff\xff\xa5@\xff\xff\x89\x01\xff\xff\x91\x11\xff\xff\xa9@\xff\xff\xaa@\xff\xff\xab@\xff\xff\xac@\xff\xff\xad@\xff\xff\xae@\xff\xff\xaf@\xff\xff\xb0@\xff\xff\xb2@\xff\xff\x99\x00\xff\xff\x9b\x00\xfe\xff\x9c\x01\xff\xff\x9e\x00\xfe\xff\x9f\x00\xff\xffr\x00\xff\xfft\x01\xff\xffu\x00\xff\xffv\x00\xff\xffx\x01\xfe\xffy\x00\xfe\xff{\x01\xff\xff\xad`\xff\xff\xff\xff\xff\xff\xe7\xcf\xff\xff\x81\x00\xff\xff\x82\x00\xff\xff\x85\x01\xff\xff\x86\x01\xff\xff\x87\x00\xfe\xff\x89\x00\xff\xff\x8a\x00\xfe\xff\x8c\x00\xff\xff\x8d\x00\xff\xff\x8f\x00\xff\xff\x90\x00\xff\xff\x92\x01\xfe\xff\x93\x00\xff\xff\x96\x01\xfe\xff\x96\x00\xff\xff\x98\x00\xff\xff\x9a\x00\xfe\xff\x9b\x00\xff\xff\x9d\x01\xff\xff\x9e\x00\xfe\xff\x9f\x00\xff\xff\xa1\x00\xff\xfft\x00\xff\xffu\x01\xff\xffw\x00\xff\xffx\x00\xff\xffz\x01\xff\xff{\x00\xff\xff}\x00\xff\xff\x7f\x00\xff\xff\xb7p\xff\xff\xf7\xef\xff\xff\x93 \xfe\xff\x84\x00\xff\xff\x85\x00\xff\xff\x87\x00\xff\xff\x88\x00\xfe\xff\x8b\x00\xff\xff\x8c\x01\xff\xff\x8d\x00\xff\xff\x8f\x00\xff\xff\x91\x01\xff\xff\x92\x01\xff\xff\x94\x00\xff\xff\x95\x00\xff\xff\x97\x01\xfe\xff\x98\x01\xfe\xff\x9a\x00\xff\xff\x9b\x01\xff\xff\x9d\x01\xff\xff\x9e\x00\xff\xff\xa0\x00\xfe\xff\xa1\x00\xff\xff\xa3\x00\xef\xffw\x01\xbf\xffw\x00\xff\xffy\x00\xff\xffz\x01\xfe\xff{\x00\xff\xff}\x00\xff\xff\x7f\x00\xff\xff\x80\x00\xff\xff\x82\x01\xff\xff\x84\x00\xff\xff\x85\x00\xff\xff\x86\x00\xfe\xff\x87\x01\xfe\xff\x89\x00\xff\xff\x8b\x01\xfe\xff\x8c\x00\xff\xff\x8e\x01\xfe\xff\x8f\x00\xff\xff\x91\x01\xfe\xff\x93\x00\xff\xff\x95\x01\xfe\xff\x95\x00\xff\xff\x97\x00\xff\xff\x98\x00\xff\xff\x9a\x00\xff\xff\x9c\x01\xff\xff\x9d\x00\xff\xff\x9f\x01\xff\xff\xa0\x00\xff\xff\xa2\x01\xff\xff\xa3\x01\xff\xff\xa4\x00\xbf\xffx\x00`\xffy\x01\xff\xffz\x00\xff\xff|\x01\xff\xff~\x01\xff\xff\x80\x00\xff\xff\x80\x00\xff\xff\x82\x01\xff\xff\x83\x00\xff\xff\x85\x00\xfe\xff\x86\x01\xff\xff\x88\x00\xff\xff\x8a\x00\xff\xff\x8b\x01\xff\xff\x8d\x00\xff\xff\x8e\x00\xff\xff\x90\x00\xff\xff\x91\x00\xff\xff\x93\x00\xff\xff\x95\x00\xff\xff\x96\x01\xfe\xff\x97\x00\xff\xff\x99\x00\xff\xff\x9b\x00\xfe\xff\x9c\x01\xfe\xff\x9d\x01\xff\xff\x9f\x00\xff\xff\xa0\x00\xff\xff\xa2\x01\xff\xff\xa3\x00\xff\xff\xa5\x00\xff\xff\xa6\x00_\x00\x00\x00\x00\xffz\x01\xcf\xff|\x00\xff\xff~\x01\xfe\xff\x80\x01\xff\xff\x81\x00\xff\xff\x82\x01\xff\xff\x83\x01\xfe\xff\x86\x01\xff\xff\x86\x00\xfe\xff\x88\x01\xfe\xff\x8a\x01\xfe\xff\x8b\x01\xfe\xff\x8d\x00\xff\xff\x8e\x00\xfe\xff\x90\x00\xfe\xff\x91\x00\xff\xff\x93\x00\xfe\xff\x95\x00\xff\xff\x97\x00\xfe\xff\x97\x00\xff\xff\x99\x00\xff\xff\x9a\x00\xff\xff\x9c\x00\xff\xff\x9e\x01\xfe\xff\x9f\x00\xff\xff\xa1\x00\xff\xff\xa2\x01\xff\xff\xa4\x01\xfe\xff\xa5\x00\xff\xff\xa7\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x00\xff\x80\x00\x10\xff}\x00\xbf\xff\x80\x01\xfe\xff\x81\x00\xff\xff\x83\x00\xff\xff\x84\x01\xfe\xff\x85\x00\xff\xff\x87\x01\xff\xff\x89\x01\xff\xff\x8a\x00\xff\xff\x8b\x00\xff\xff\x8d\x01\xfe\xff\x8e\x00\xff\xff\x90\x00\xff\xff\x92\x01\xfe\xff\x94\x00\xfe\xff\x94\x00\xff\xff\x96\x00\xff\xff\x98\x00\xff\xff\x99\x00\xff\xff\x9b\x00\xff\xff\x9c\x00\xff\xff\x9d\x00\xff\xff\x9f\x01\xff\xff\xa1\x01\xff\xff\xa2\x01\xff\xff\xa3\x00\xff\xff\xa5\x00\xff\xff\xa7\x00\xcf\xff\x9f\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x81\x00_\xff\x83\x00\xbf\xff\x84\x00\xef\xff\x85\x00\xfe\xff\x87\x00\xff\xff\x89\x01\xfe\xff\x8a\x00\xff\xff\x8c\x00\xff\xff\x8d\x00\xff\xff\x90\x01\xfe\xff\x90\x00\xff\xff\x92\x01\xff\xff\x94\x01\xff\xff\x95\x00\xff\xff\x97\x00\xff\xff\x98\x00\xff\xff\x9a\x01\xfe\xff\x9b\x00\xff\xff\x9d\x01\xfe\xff\x9e\x00\xff\xff\x9f\x00\xff\xff\xa1\x00\xff\xff\xa3\x01\xff\xff\xa4\x00\xff\xff\xa5\x00\xbf\xff\xa6\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x07\x80\x00\x00\x01\x80\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x01\x80\x00\x00\x01\xe0\x00\x00\x07'

这里打印了两行是Response对象的两个属性,一个是text【str类型】,另外一个是content【字节】

import requests


headers = {
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
}
reponse = requests.get("https://static.zhihu.com/heifetz/favicon.ico",headers=headers)
with open("favicon.ico","wb") as f:
    f.write(reponse.content)

结果
 

 POST请求

前面我们了解了最基本的 GET 请求另外一种比较常见的请求方式是 POST 使用 requests实现 POST 请求同样非常简单,示例如下:

import requests

date = {
    "name":"germey",
    "age":22
}

response = requests.post(url="http://192.168.1.104/post",data=date)
print(response.text)

结果:
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {
    "age": "22", 
    "name": "germey"
  }, 
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate", 
    "Connection": "keep-alive", 
    "Content-Length": "18", 
    "Content-Type": "application/x-www-form-urlencoded", 
    "Host": "192.168.1.104", 
    "User-Agent": "python-requests/2.25.1"
  }, 
  "json": null, 
  "origin": "192.168.1.101", 
  "url": "http://192.168.1.104/post"
}

常用的响应

import requests

response = requests.post(url="http://192.168.1.104/post",data=date)
print(type(response.status_code),response.status_code)
print(type(response.headers),response.headers)
print(type(response.cookies),response.cookies)
print(type(response.url),response.url)
print(type(response.history),response.history)


结果:
<class 'int'> 200
<class 'requests.structures.CaseInsensitiveDict'> {'Server': 'gunicorn/19.9.0', 'Date': 'Tue, 30 Nov 2021 14:26:55 GMT', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '468', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true'}
<class 'requests.cookies.RequestsCookieJar'> <RequestsCookieJar[]>
<class 'str'> http://192.168.1.104/post
<class 'list'> []

这里分别打印输出 status_code 属性得到状态码,输出 headers 属性得到响应头,输出 cookies 属性得到 Cookies ,输出 url 属性得到URL ,输出 history 属性得到请求历史

状态码常用来判断请求是否成功,而 requests 还提供了一个 置的状态码查询对象 requests.codes, 示例如下:

import requests

response = requests.post(url="http://192.168.1.104/post",data=date)
exit() if not response.status_code == requests.codes.ok else print("Request Successfully")

结果:
Request Successfully

常用的返回码和响应的查询条件

 

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Smart_look/article/details/121643058

智能推荐

info级别日志与debug_debug中的计算是否在info级别也会跑-程序员宅基地

文章浏览阅读6.3k次。日志默认info级别debug日志不会打印,但是会执行日志填充的数据例如:logger.debug("日志输出",2*10); 1. 2*10会先执行出结果,然后继续往下走2. 在ch.qos.logback.classic.Logger#filterAndLog_1方法中判断是否符合级别要求是否需要输出3.如图:..._debug中的计算是否在info级别也会跑

Third calibration example - Calibration using Heikkil�'s data (planar and non-planar calibration rig-程序员宅基地

文章浏览阅读1.4k次。Similarly to the previous example, let us apply our calibration engine onto the data that comes with the originalcalibration toolbox of Heikkil� from the University of Oulu. Once again. do not bothe_non-planar calibration

物联网常用的网络协议:MQTT、AMQP、HTTP、CoAP、LwM2M_lmm2m和mqtt-程序员宅基地

文章浏览阅读1w次,点赞10次,收藏63次。物联网常用的网络协议:MQTT、AMQP、HTTP、CoAP、LwM2M物联网设备间沟通的语言,就是网络协议。设备间想相互交流,通信双方必须使用同一种“语言”。比如说你和中国人问好说’你好‘、日本人问好要说‘こんにちは’、和英国人问好要说‘hello’.说起网络协议,你可能马上就想到了 HTTP 协议。是的,在日常的 Web 开发中,我们总是需要跟它打交道,因为 HTTP 协议是互联网的主流网络协议。类似地,应用在互联网中的网络协议,还有收发电子邮件的 POP3 、SMTP 和 IMAP 协议,以及_lmm2m和mqtt

fortran使用MKL函数库中的geev计算一般矩阵的特征值与特征向量_fortran求矩阵特征值-程序员宅基地

文章浏览阅读7.4k次,点赞4次,收藏20次。这篇博文简要记录一下使用MKL函数库计算一般矩阵的特征值与特征向量对形如对称矩阵或是埃尔米特等特殊矩阵有其对应的子程序,在这里先不涉及。有需求的可以自行查阅MKL官方文档下面给出本次示例代码:代码使用f95接口。f77借口参数太多,笔者太懒<不过懒惰是创新的原动力^_^>program testGeev use lapack95 implicit..._fortran求矩阵特征值

Numpy, Scipy, Matplotlib基本用法_np.imresize-程序员宅基地

文章浏览阅读147次。学习内容来自:Numpy Tutorial文章目录Array SlicingArray IndexingMathematical ManipulationBroadcastingImage Processing基本的用法课程里面说的挺详细了。 特别记录一些需要关注的点。Array Slicing使用固定数字进行array寻址会导致数组降维。y = np.random.random((3,..._np.imresize

蓝桥杯 历届试题 回文数字 C++_c++蓝桥杯 回文数-程序员宅基地

文章浏览阅读355次。题目阅览 观察数字:12321,123321 都有一个共同的特征,无论从左到右读还是从右向左读,都是相同的。这样的数字叫做:回文数字。  本题要求你找到一些5位或6位的十进制数字。满足如下要求:  该数字的各个数位之和等于输入的整数。  输入格式  一个正整数 n (10<n<100), 表示要求满足的数位和。  输出格式若干行,每行包含一个满足要求的5位或6位整数。  数字按从小到大的顺序排列。  如果没有满足条件的,输出:-1样例输入144样例输出199899_c++蓝桥杯 回文数

随便推点

Java生成二维码,扫描并跳转到指定的网站_java扫二维码进入自己制作的网页-程序员宅基地

文章浏览阅读6.2k次,点赞3次,收藏13次。需要的pom文件 &lt;dependency&gt; &lt;groupId&gt;com.google.zxing&lt;/groupId&gt; &lt;artifactId&gt;core&lt;/artifactId&gt; &lt;version&gt;3.1.0&lt;/version&gt;_java扫二维码进入自己制作的网页

python:多波段遥感影像分离成单波段影像_一个多波段影像分解成多个单波段影像-程序员宅基地

文章浏览阅读650次。在遥感图像处理中,我们经常需要将多波段遥感影像拆分成多个单波段图像,以便进行各种分析和后续处理。本篇博客将介绍一个用Python编写的程序,该程序可以读取多波段遥感影像,将其拆分为单波段图像,并保存为单独的文件。本程序使用GDAL库来处理遥感影像数据,以及NumPy库来进行数组操作。结果如下图所示,选中的影像为输入的多波段影像,其他影像分别为拆分后的多波段影像。_一个多波段影像分解成多个单波段影像

移动硬盘突然在电脑上无法显示_电脑无法显示移动硬盘-程序员宅基地

文章浏览阅读5.1k次,点赞2次,收藏4次。0前言一直用的好好的移动硬盘突然不显示了,前段时间因为比较忙,一直没顾得上管它,趁这个假期,好好捅咕了一番,总算是弄好了,特此将解决的过程记录如下:1.问题描述 1.我的移动硬盘在其他人的电脑上能够正常显示和使用 2.其他移动硬盘在我电脑上能够正常的显示和使用 3.在我的电脑上,该移动硬盘,既不显示盘符,磁盘管理 又不显示该磁盘2.问题分析1.我的移动硬盘能够在其他人电脑上_电脑无法显示移动硬盘

Linux开机启动过程(16):start_kernel()->rest_init()启动成功_linux 标志着kernel启动完成-程序员宅基地

文章浏览阅读1k次。Kernel initialization. Part 10.在原文的基础上添加了5.10.13部分的源码解读。End of the linux kernel initialization processThis is tenth part of the chapter about linux kernel initialization process and in the previous part we saw the initialization of the RCU and stopped o_linux 标志着kernel启动完成

Scala安装和开发环境配置教程_scala安装及环境配置-程序员宅基地

文章浏览阅读5.3k次,点赞5次,收藏23次。Scala语言概述:Scala语言是一门以Java虚拟机为运行环境,支持面向对象和函数式编程的静态语言,java语言是面向对象的,所以代码写起来就会相对比较模块儿,而函数式编程语言相对比较简洁_scala安装及环境配置

深扒人脸识别60年技术发展史_人脸识别发展历史-程序员宅基地

文章浏览阅读2.4k次。“他来听我的演唱会,门票换了手铐一对”。最近歌神张学友变阿SIR,演唱会上频频抓到罪犯,将人脸识别技术又一次推到了大众的视线中。要说人脸识别技术的爆发,当属去年9月份苹果iPhone x的发布,不再需要指纹,只需要扫描面部就可以轻松解锁手机。任何技术一旦进入智能手机这个消费市场,尤其是被苹果这个标志性的品牌采用,就意味着它将成为一种趋势,一个智能设备的标配。在智能手机快速崛起的这几年,其密码锁..._人脸识别发展历史