
Web || HTTP || WebSocket
文章平均质量分 59
Web || HTTP || WebSocket相关知识
ikeepo
https://ikeepo.github.io/
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
(20210301已解决)Can‘t connect to HTTPS URL because the SSL module is not available.
Overview使用requests发送消息,出现如下错误:Can’t connect to HTTPS URL because the SSL module is not available.请求的url并无问题,Linux端的运行也正常,只有Windows下面anaconda运行异常。Solution参考中3,4,5是比较常见的几种解释,于我情况无作用。我的情况是采用Reference1中第二个答案:# copy the fileslibcrypto-1_1-x64.*li..原创 2021-03-06 10:18:46 · 2476 阅读 · 2 评论 -
将DataFrame作为邮件正文HTML发送 in Python
OverviewTo convert this question into english, maybe:How to convert a DataFrame into a petty HTML table and send it over Email, like this one here.From R1,there is a module named pretty_html_table .pretty_html_tableThe objective of this package is..原创 2021-01-29 20:32:57 · 1630 阅读 · 1 评论 -
理解full-duplex||IETF||RFC||Web IDL||W3C
full-duplexA full-duplex(FDX) system, or somethings called double-duplex(HDX), allows communication in both directions, and unlike half-duplex, allows this to happen simultaneously.IETFThe Internet Engineering Task Force (IETF) is a large open inter..原创 2020-12-19 19:49:01 · 367 阅读 · 1 评论 -
理解SIGNED endpoint
endpoint《理解endpoint vs API 》signed《理解signature on API Requests》《理解digital signatures vs MAC on cryptography》You can take signed endpoint simply as the endpoint which need a signature param.原创 2020-12-11 19:52:12 · 174 阅读 · 0 评论 -
理解signature on API Requests
signature关于signature 参见《理解digital signatures vs MAC on cryptography》signature on APIsignature 与API在一起,指请求api地址的时候,将signature作为一个参数加到query字段中。比如(伪代码):# 原query字段querystring="stock=000001&type=sh"# 第一步:将query字段与encryption key放在一起计算macmac=macAl..原创 2020-12-11 19:51:22 · 393 阅读 · 0 评论 -
理解Data Centric VS. Document Centric VS. mixed-content XML
OverviewGenerally speaking, Document-Centric and Data-Centric are two broad applications areas of XML technologies.Document Centric XMLDocument Centric(document-oriented) uses XML to impose structure on information that rarely fits into a relational..原创 2020-12-06 14:37:08 · 220 阅读 · 0 评论 -
理解robots.txt on url||爬虫
robots.txtrobos.txtRobots.txt 规范The robots exclusion standard, also known as the robots exclusion protocol or simply robots.txt, is a standard used by websites to communicate with web crawlers and other web robots.The standard specifies how to info..原创 2020-12-06 14:10:15 · 250 阅读 · 0 评论 -
理解endpoint vs API
endpointApplication Programm Interface (API) permits the interaction between two systems.In simple terms, an API endpoint is the point entry in a communication channel when two systems are interacting.It refers to touchpoints of the communication betw..原创 2020-12-06 14:08:36 · 1538 阅读 · 0 评论 -
理解urllib.parse in Python||URL结构
URLA URL (Uniform Resource Locator), more commonly known as a “web address”, specifies the location of a resource (such as a web page) on the internet.The URL also specifies how to retrieve that resource, also known as the “Protocol”, such as HTTP, HTT..原创 2020-12-05 15:12:41 · 198 阅读 · 0 评论 -
(20201201- 问题已解决)request爬虫beautifulsoup无法提取tbody
问题描述爬虫任务中,所需内容在:<table class="table_search_"> <tbody> <tr>...</tr> <tr>...</tr> <tr>...</tr>可以定位到table class="table_search_",但是没有想要的内容。即,无法提取tbody内容。问题解析[爬虫]xpath无法定位tbo..原创 2020-12-05 15:11:21 · 4756 阅读 · 1 评论 -
理解xpath||lxml||markup||markdown
XMLExtensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.The design goals of XML emphasize simplictiy, generality, and usability across the ..原创 2020-12-05 09:44:28 · 291 阅读 · 0 评论 -
理解lxml module in Python
OverviewhomepagePython 爬虫利器三之 Xpath 语法与 lxml 库的用法The ElementTree XML API in PythonThe lxml XML toolkit is a Pythonic binding for the C libraries libxml2 and libxslt. It is unique in that it combines the speed and XML feature completeness of these l..原创 2020-12-05 09:43:30 · 215 阅读 · 0 评论 -
理解http request headers中Referer||User-Agent||Cookie...的意义
缘起用Python写爬虫,对于AJAX内容,需要在request.get(url, headers)中传入headers,需要了解headers中各项的意义。Request header 请求头HTTP header fields are components of the header section of request and response messages in the Hypertext Transfer Protocol (HTTP). They define the oper..原创 2020-12-05 09:37:33 · 2353 阅读 · 0 评论 -
(已解决)Sanic websocket concurrent.futures._base.CancelledError
问题描述websocket方式连接Sanic服务器,经常断开连接。解决方案aiohttp throws CancelledError into coroutine if http connection was disconnected.1这个问题本源在于websocket连接断开了,在本例中因为websocket server是每隔几分钟推送有一次数据,时间间隔太长导致连接断开。进而导致如下错误:websockets.exceptions.ConnectionClosedError: co..原创 2020-05-31 15:12:36 · 4732 阅读 · 2 评论 -
on_open() missing 1 required positional argument: 'ws'
问题描述将websocket的on_open()封装到一个类中,就会出现如题问题。解决方案问题出在websocket的_callback方法调用上。 def _callback(self, callback, *args): if callback: try: if inspect.ismethod(ca...原创 2020-04-30 21:50:17 · 1128 阅读 · 0 评论 -
网络高频概念理解:TCP/IP、握手通道、HTTP三次握手
HTTP:HyperText Transfer Protocol,超文本传输协议,菜鸟教程是一种无状态的请求/响应的网络传输协议。基于TCP/IP通信协议(通过一个可靠的链接)传递数据。HTTP协议工作于客户端-服务端架构。HTTP客户端(浏览器)通过URL向HTTP服务端(WEB服务器)发送请求。默认端口号80.HTTP无连接、媒体独立、无状态。CGI Program(Wiki...原创 2020-04-27 22:29:54 · 743 阅读 · 0 评论 -
理解WebSocket协议中控制帧:close、ping、pong
控制帧控制帧用于WebSocket协议交换状态信息,控制帧可以插在消息片段之间。所有的控制帧的负载长度均不大于125字节,并且禁止对控制帧进行分片处理。目前控制帧的操作码定义了oxo8(关闭帧)、oxo9(Ping帧)、oxoA(Pong帧)。关闭帧(oxo8)关闭帧可能包含数据部分,该部分表名了关闭的原因。客户端发送给服务器的关闭帧必须掩码处理。应用程序在发送了一个关闭帧后...原创 2020-04-27 22:28:19 · 9421 阅读 · 0 评论 -
(20200422已解决)RuntimeWarning: coroutine 'WebSocketCommonProtocol.send' was never awaited
问题描述websocket 服务端爆出如上问题。解决方案问题的出现是由于在async def定义的函数内部使用了loop=asyncio.get_event_loop(),需要将事件循环提取到async def函数外面ReferencesLearning asyncio: “coroutine was never awaited” warning errorCommo...原创 2020-04-26 22:27:26 · 18361 阅读 · 2 评论 -
on_close() missing 1 required positional argument: 'ws'
问题描述class Something(): def on_message(self,ws, message): pass ... def main(self): websocket.enableTrace(True) ws = websocket.WebSocketApp("wss://stream.b...原创 2020-04-19 10:09:09 · 1869 阅读 · 3 评论 -
线程、进程、协程概念辨析
线程和进程线程、进程经常放在一起对比:《线程||进程||行程||多线程||多进程一次搞清》《IO密集型任务(多线程)||计算密集型(多进程)》线程是最小单位,进程内至少包含一个线程。对操作系统来说,线程是最小的执行单元,进程是最小的资源管理单元。进程间的切换(涉及栈、寄存器、虚拟内存、文件句柄等)开销较大,但是相对安全;不同进程通过进程间通讯来通信。线程是比进程更小的、CPU调度...原创 2020-03-11 13:51:45 · 306 阅读 · 0 评论 -
单核CPU、并行、进程、线程、纤程、协程出现必要性解析
并发/并行从物理基础元素角度来看,当只有一个CPU时,执行一个程序这个程序就会一直占用CPU,直到程序运行结束。如果这个程序的运行过程中,需要用到CPU的部分很快就结束了,程序的其他环节(比如IO阻塞等)正在占用时间,此时CPU是空置的。于是就有了并发。并发的不足并发执行加速了对CPU的使用效率,也带来了问题。程序A运行到一半,程序B进来抢占CPU,程序A的中间状态/内存/变量...原创 2020-03-11 13:50:55 · 765 阅读 · 0 评论 -
HTTP包体、MIME概念理解
HTTP包体HTTP是一个客户端(用户)和服务端(网站)之间请求和应答的标准,通常使用TCP协议。通过使用网页浏览器、网络爬虫或者其它的工具,客户端发起一个HTTP请求到服务器上指定端口(默认端口为80)。我们称这个客户端为用户代理程序(user agent)。应答的服务器上存储着一些资源,比如HTML文件和图像。我们称这个应答服务器为源服务器(origin server)。在用户代理...原创 2020-03-07 07:21:37 · 1151 阅读 · 0 评论