
python
Weby-Weby
前端码农,也写写cocoscreator游戏,研究下新技术什么的,回复消息可能较慢,敬请谅解。
展开
-
Sniffing and sending packets is not available: winpcap is not installed
执行python抓包程序时,控制台报错:Sniffing and sending packets is not available: winpcap is not installed意思是:嗅探和发送数据包不可用:未安装WinPCAPwinpcap(windows packet capture)是windows平台下一个免费,公共的网络访问系统。开发winpcap这个项目的目的在于为...原创 2019-05-14 09:15:14 · 9089 阅读 · 1 评论 -
cannot import name 'NPCAP_PATH' from 'scapy.arch.pcapdnet'
在使用scapy进行抓包时,报错:cannot import name 'NPCAP_PATH' from 'scapy.arch.pcapdnet'windows平台上pip下载的会出现这种问题,linux不会。解决办法:替换scapy文件夹:下载路径:https://github.com/secdev/scapy我的的路径:C:\Python\Python37-32\...原创 2019-05-14 09:22:55 · 1525 阅读 · 0 评论 -
pygame中的碰撞检测
1,精灵与精灵pygame.sprite.collide_rect(first, second)2,精灵与组#第一个参数是精灵,#第二个参数是精灵组,#第三个参数为True,则碰撞检测后,组中所有碰撞的精灵被删除#返回 组中被碰撞的精灵collide_list = pygame.sprite.spritecollide(sprite,group,False)3,组与组...原创 2019-05-31 13:06:55 · 9411 阅读 · 3 评论 -
使用python中的open()生成、记录日志
import osimport timeos用于获取当前目录,time用于获取时间,用作文件名。获取当前目录:retval = os.getcwd()(注意:可以用 os.chdir("D:/work/ulab") 改变当前目录)获取当前时间,并按照我们要的格式输出:fileDay = time.strftime("%Y%m%d", time.localtime()...原创 2019-06-19 09:56:25 · 792 阅读 · 0 评论 -
TypeError: a bytes-like object is required, not 'str'
报错信息:TypeError: a bytes-like object is required, not 'str'报错位置: header, data = msg.split('\r\n\r\n', 1)修改后:header, data = msg.decode().split('\r\n\r\n', 1)原理:str通过encode()方法可以编码为指定...原创 2019-06-18 11:29:29 · 1815 阅读 · 0 评论 -
python编写全民漂移自动抽奖脚本
python编写全民漂移自动抽奖脚本github地址:https://github.com/wyysgithub/DriftScript在抽奖页面点击+5,会开始播放15秒广告;广告播放完毕,需要点击关闭广告才能回抽奖页面,并增加抽奖次数5次;点击开始,转盘会转5~7秒,然后页面显示抽奖结果;抽奖结果会有两种情况,一是可以直接点击领取的,二是需要再次观看广告再领取的,也可以点击关闭重新...原创 2019-07-12 10:07:25 · 714 阅读 · 0 评论 -
使用scrapy爬网页出现403错误
报错内容如下:2019-09-27 13:32:17 [scrapy.core.engine] DEBUG: Crawled (403) <GET https://movie.douban.com/robots.txt> (referer: None)2019-09-27 13:32:17 [scrapy.core.engine] DEBUG: Crawled (403) &l...原创 2019-09-27 13:42:27 · 4156 阅读 · 1 评论 -
谷歌浏览器插件xpath helper 的安装和使用
xpath helper是用来在页面上快速定位元素的一个插件,方便爬虫的时候编写解析代码。安装:下载之后,直接双击,或者拖进扩展程序可以安装。如果出现错误无效,可以将插件后缀改为.rar,然后解压出来。点击“加载已解压的扩展程序” ,选择刚刚解压的目录即可。使用:安装完成,必须重启浏览器。使用的快捷键为:ctrl + shift + x按住 ctrl + sh...原创 2019-09-27 16:24:43 · 2765 阅读 · 0 评论