会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Eliphaz
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
下一页
2020年11月24日
验证码破解全家桶(滑动验证码、数字验证码、极验验证码)
摘要: 一、滑动验证码:(以企查查为例) from selenium import webdriverfrom selenium.common.exceptions import NoSuchElementExceptionfrom selenium.webdriver import ActionChain
阅读全文
posted @ 2020-11-24 11:25 Eliphaz
阅读(749)
评论(0)
推荐(0)
2020年11月13日
Celery(一)基本介绍
摘要: 一、什么是Celery 1.1、celery是什么 Celery的架构由三部分组成,消息中间件(message broker),任务执行单元(worker)和任务执行结果存储(task result store)组成 消息中间件 Celery本身不提供消息服务,但是可以方便的和第三方提供的消息中间件
阅读全文
posted @ 2020-11-13 20:01 Eliphaz
阅读(316)
评论(6)
推荐(0)
2020年11月10日
多线程、线程池、GIL锁
摘要: 一、线程与进程的关系 默认一个进程至少一个线程 (1)区别:进程只是占内存,线程才消耗CPU; 线程在进程下行进 同一进程下不同线程间数据很易共享 二、全局解释器锁(GIL) GIL是解释器用于同步线程的一种机制,只允许同一时间执行一个线程 常见的GIL解释器有:Cpython与Ruby MRI 三
阅读全文
posted @ 2020-11-10 13:49 Eliphaz
阅读(136)
评论(0)
推荐(0)
2020年10月23日
爬虫乱码究极方案
摘要: text = response.text.encode() #获取页面编码 code = chardet.detect(text) #code 的输出是这样的的一个字典{'confidence': 0.99, 'encoding': 'utf-8'} response.encoding = code
阅读全文
posted @ 2020-10-23 20:44 Eliphaz
阅读(99)
评论(0)
推荐(0)
2020年10月21日
13位时间戳转为日期时间、获取当前时间的13位时间戳
摘要: import time # 输入毫秒级的时间,转出正常格式的时间 # def timeStamp(timeNum): timeStamp = float(1603346322020/1000) timeArray = time.localtime(timeStamp) otherStyleTime
阅读全文
posted @ 2020-10-21 15:45 Eliphaz
阅读(8551)
评论(0)
推荐(0)
2020年10月10日
chrome检测到非法调试:修改Selenium中的 window.navigator.webdriver
摘要: 通过 Google 的Chrome Devtools-Protocol(Chrome 开发工具协议)简称CDP,给定一段 JavaScript 代码,让 Chrome 刚刚打开页面,还没有运行网站自带的 JavaScript代码时,执行给定的代码。 使用driver.execute_cdp_cmd:
阅读全文
posted @ 2020-10-10 14:51 Eliphaz
阅读(1252)
评论(0)
推荐(0)
2020年9月30日
python 俄语、英语翻译成中文
摘要: import langid from translate import Translator #语言处理 想要翻译更多种语言用langid去得到语言的代号进行判断 def tranlation(text): ''' :param text: input need translate language
阅读全文
posted @ 2020-09-30 16:36 Eliphaz
阅读(793)
评论(0)
推荐(0)
2020年9月18日
监测进程是否在运行
摘要: 最近项目中需要去判断进程爬虫是否正在运行,本来使用win32com,但是发现在被django view.py中调用的时候居然总是提示‘Invalid syntax’,后来换用psutil就能正常运行。并且psutil是跨平台的。 一、使用win32com来判断进程是否存在 import os imp
阅读全文
posted @ 2020-09-18 16:36 Eliphaz
阅读(496)
评论(0)
推荐(0)
2020年9月16日
unittest生成测试报告
摘要: import time import unittest from selenium import webdriver #iwebshop_login_testcase.py class IwebshopLoginTest(unittest.TestSuite): def setUp(self): s
阅读全文
posted @ 2020-09-16 20:25 Eliphaz
阅读(139)
评论(0)
推荐(0)
unittest断言
摘要: (1)基本布尔型断言 (2)比较断言 例子: import unittest def add(a,b): return a+b #继承unittest.TestCase类 class TestCase01(unittest.TestCase): #方法名必须以test开头 def testcase_
阅读全文
posted @ 2020-09-16 15:42 Eliphaz
阅读(188)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
下一页
公告