摘要: # -*- coding: utf-8 -*- import re def clear_str(string): """ 清理字符串 """ clear_string = strQ2B(string).strip() return clear_string def handle_space(stri 阅读全文
posted @ 2022-04-28 11:04 二二二狗子 阅读(173) 评论(0) 推荐(0)
摘要: Python 在程序并行化方面多少有些声名狼藉。撇开技术上的问题,例如线程的实现和 GIL,我觉得错误的教学指导才是主要问题。常见的经典 Python 多线程、多进程教程多显得偏"重"。而且往往隔靴搔痒,没有深入探讨日常工作中最有用的内容。 传统的例子 简单搜索下"Python 多线程教程",不难发 阅读全文
posted @ 2022-04-16 15:26 二二二狗子 阅读(313) 评论(0) 推荐(0)
摘要: ![](https://img2022.cnblogs.com/blog/2012154/202204/2012154-20220416151030402-534052146.png) 阅读全文
posted @ 2022-04-16 15:11 二二二狗子 阅读(90) 评论(0) 推荐(0)
摘要: import requests from retrying import retry PROXY_POOL_URL = 'http://127.0.0.1:5555/random' def get_proxxy(): response = requests.get(PROXY_POOL_URL) i 阅读全文
posted @ 2022-04-04 17:24 二二二狗子 阅读(62) 评论(0) 推荐(0)
摘要: 1. 基本使用 同步模式 from playwright.sync_api import sync_playwright url = 'https://www.baidu.com' with sync_playwright() as p: for browser_type in [p.chromiu 阅读全文
posted @ 2022-03-13 18:09 二二二狗子 阅读(2202) 评论(0) 推荐(1)
摘要: ![](https://img2022.cnblogs.com/blog/2012154/202202/2012154-20220216165614673-568857812.png) 阅读全文
posted @ 2022-02-16 16:59 二二二狗子 阅读(60) 评论(0) 推荐(0)
摘要: feapder 是一款上手简单,功能强大的Python爬虫框架,使用方式类似scrapy,方便由scrapy框架切换过来,框架内置3种爬虫: AirSpider爬虫比较轻量,学习成本低。面对一些数据量较少,无需断点续爬,无需分布式采集的需求,可采用此爬虫。 Spider是一款基于redis的分布式爬 阅读全文
posted @ 2022-02-14 09:31 二二二狗子 阅读(1475) 评论(0) 推荐(1)
摘要: https://fastapi.tiangolo.com/zh/python-types/ https://pydantic-docs.helpmanual.io/visual_studio_code/ 阅读全文
posted @ 2022-01-28 17:46 二二二狗子 阅读(34) 评论(0) 推荐(0)
摘要: from copy import deepcopy def merge_list_on_keys(new_list, old_list, key_list, remaining_keys=None, replace=True): """ 对 new_list 和 old_list 根据 key_li 阅读全文
posted @ 2022-01-26 14:17 二二二狗子 阅读(328) 评论(0) 推荐(0)
摘要: ![](https://img2020.cnblogs.com/blog/2012154/202201/2012154-20220103185539990-543365358.png) 阅读全文
posted @ 2022-01-03 18:56 二二二狗子 阅读(39) 评论(0) 推荐(0)