MCPcopy Create free account

hub / github.com/NanmiCoder/CrawlerTutorial / functions

Functions724 in github.com/NanmiCoder/CrawlerTutorial

↓ 2 callersMethodnavigate_to_login
导航到登录页面
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/qrcode_login.py:137
↓ 2 callersMethodnormalize
标准化日期时间格式 Args: text: 日期时间字符串 output_format: 输出格式 Returns: 标准化后的字符串,解析失败返回原字符串
源代码/爬虫进阶/09_数据清洗与预处理/data_normalizer.py:111
↓ 2 callersMethodnormalize_datetime
标准化为日期时间格式 (YYYY-MM-DD HH:MM:SS)
源代码/爬虫进阶/09_数据清洗与预处理/data_normalizer.py:137
↓ 2 callersMethodnormalize_record
标准化数据记录 Args: record: 数据记录 date_fields: 需要标准化的日期字段 number_fields: 需要标准化的数值字段 text_fi
源代码/爬虫进阶/09_数据清洗与预处理/data_normalizer.py:357
↓ 2 callersFunctionparse_video_info_from_url
从 B站视频 URL 中解析视频 ID 支持的格式: - https://www.bilibili.com/video/BV1dwuKzmE26/?spm_id_from=... - https://www.bilibili.com/video/BV1d54y1g
源代码/爬虫进阶/11_进阶综合实战项目/tools/sign.py:162
↓ 2 callersMethodpie_chart
创建交互式饼图 Args: data: [(名称, 数值), ...] 列表 title: 标题 output_path: 输出路径 rose_type: 玫瑰图类型
源代码/爬虫进阶/10_数据分析与可视化/chart_demo.py:336
↓ 2 callersMethodquery
从给定的 SQL 中查询记录,返回的是一个列表 :param sql: 查询的sql :param args: sql中传递动态参数列表 :return:
源代码/爬虫入门/10_爬虫入门实战3_数据存储实现/async_db.py:16
↓ 2 callersMethodrecord_usage
记录一次使用
源代码/爬虫进阶/08_验证码识别与处理/captcha_service.py:211
↓ 2 callersMethodrelease
释放上下文
源代码/爬虫进阶/05_Playwright进阶_反检测与性能优化/performance_optimization.py:98
↓ 2 callersMethodrelease
释放并发许可
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/rate_limiter.py:218
↓ 2 callersMethodsave
保存数据到 JSON 文件
源代码/爬虫进阶/11_进阶综合实战项目/store/backend.py:83
↓ 2 callersMethodsearch_video_by_keyword
按关键词搜索视频 Args: keyword: 搜索关键词 page: 页码(从1开始) page_size: 每页数量(B站固定为20) order: 排序方式(空=
源代码/爬虫进阶/11_进阶综合实战项目/client/bilibili_client.py:192
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/10_爬虫入门实战3_数据存储实现/main.py:57
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/11_爬虫入门实战4_高效率的爬虫实现/run_crawler_multi_process.py:31
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/11_爬虫入门实战4_高效率的爬虫实现/run_crawler_multi_coroutine.py:32
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/11_爬虫入门实战4_高效率的爬虫实现/run_crawler_multi_thread.py:32
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/09_爬虫入门实战2_动态数据提取/002_源码实现_同步版本.py:55
↓ 2 callersFunctionsend_request
公共的发送请求的函数 :param page_start: 分页起始位置 :param page_size: 每一页的长度 :return:
源代码/爬虫入门/09_爬虫入门实战2_动态数据提取/003_源码实现_异步版本.py:57
↓ 2 callersMethodsend_verification_code
发送验证码 Returns: 是否发送成功
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/sms_login.py:81
↓ 2 callersMethodsetup
设置资源拦截
源代码/爬虫进阶/05_Playwright进阶_反检测与性能优化/performance_optimization.py:35
↓ 2 callersMethodsign
对请求参数进行签名 签名流程: 1. 添加当前时间戳 wts 2. 按 key 字典序排序 3. 过滤特殊字符 4. URL 编码后与 salt 拼接 5. 计算 MD5 作为 w_r
源代码/爬虫进阶/11_进阶综合实战项目/tools/sign.py:94
↓ 2 callersMethodsolve_image
使用本地 OCR 识别
源代码/爬虫进阶/08_验证码识别与处理/captcha_service.py:34
↓ 2 callersMethodstart
启动客户端
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/client.py:48
↓ 2 callersMethodsubmit_login
提交登录 Returns: 是否登录成功
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/sms_login.py:105
↓ 2 callersMethodto_halfwidth
全角字符转半角 将全角数字、字母、标点转为半角
源代码/爬虫进阶/09_数据清洗与预处理/text_cleaner.py:215
↓ 2 callersMethodtokenize
分词 Args: text: 输入文本 min_length: 最小词长度 Returns: 词语列表
源代码/爬虫进阶/10_数据分析与可视化/wordcloud_generator.py:72
↓ 2 callersMethodupdate_cookies
从浏览器上下文更新 Cookie 登录成功后调用此方法,将浏览器的 Cookie 同步到客户端。 Args: browser_context: Playwright 浏览器上下文
源代码/爬虫进阶/11_进阶综合实战项目/client/bilibili_client.py:64
↓ 2 callersMethodverify
验证 Cookie 是否有效 Returns: Cookie 是否有效
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/bilibili_cookie.py:253
↓ 2 callersFunctionverify_bilibili_cookies
验证B站Cookie是否有效 Args: cookies: Cookie字典 Returns: 有效返回用户信息,无效返回None
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/bilibili_qrcode_login.py:334
↓ 2 callersMethodwait
等待随机时间 Returns: 实际等待的时间(秒)
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/rate_limiter.py:106
↓ 2 callersMethodwill_expire_soon
检查 Cookie 是否即将过期 Args: cookies: Cookie 列表 threshold_hours: 阈值小时数 Returns: 是否在阈值时间内过期
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/login_state_checker.py:263
↓ 2 callersMethodword_frequency
词频统计 Args: text_field: 文本字段名 top_n: 返回 Top N min_length: 最小词长度 Returns: (词语
源代码/爬虫进阶/11_进阶综合实战项目/analysis/report.py:98
↓ 1 callersMethod__init__
初始化数据分析器 Args: data: 数据列表 output_dir: 输出目录
源代码/爬虫进阶/11_进阶综合实战项目/analysis/report.py:61
↓ 1 callersMethod__init__
Args: login_url: 登录页 URL phone_input_selector: 手机号输入框选择器 send_code_btn_selector: 发送验证码按钮选择器 c
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/sms_login.py:13
↓ 1 callersMethod__init__
初始化检测器 Args: timeout: 检测超时时间(秒) check_urls: 自定义检测 URL 列表
源代码/爬虫进阶/03_代理IP的使用与管理/proxy_pool/checker.py:30
↓ 1 callersMethod__init__
(self, message: str, url: Optional[str] = None)
源代码/爬虫进阶/01_工程化爬虫开发规范/exception_demo.py:26
↓ 1 callersMethod__init__
(self, message: str, url: Optional[str] = None)
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/exceptions.py:10
↓ 1 callersFunction_check_passed
检查是否通过
源代码/爬虫进阶/05_Playwright进阶_反检测与性能优化/stealth_demo.py:155
↓ 1 callersMethod_cleanup_stale_proxies
清理过期代理
源代码/爬虫进阶/03_代理IP的使用与管理/proxy_pool/pool.py:156
↓ 1 callersMethod_crawl_note_details
爬取帖子详情
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/crawler.py:100
↓ 1 callersMethod_crawl_note_list
爬取帖子列表
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/crawler.py:68
↓ 1 callersMethod_create_login
根据方式创建登录实例
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:364
↓ 1 callersMethod_do_login
执行登录 Returns: bool: 是否登录成功
源代码/爬虫进阶/11_进阶综合实战项目/crawler/spider.py:128
↓ 1 callersMethod_download_qrcode
下载二维码图片 Args: url: 二维码图片 URL Returns: str: Base64 编码的图片数据
源代码/爬虫进阶/11_进阶综合实战项目/login/auth.py:309
↓ 1 callersMethod_extract_cookies
从响应中提取B站Cookie
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/bilibili_qrcode_login.py:259
↓ 1 callersMethod_find_login_qrcode
查找登录二维码 Returns: str: Base64 编码的二维码图片,如果未找到返回 None
源代码/爬虫进阶/11_进阶综合实战项目/login/auth.py:272
↓ 1 callersMethod_get_previous_page_number
获取上一页分页号
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/crawler.py:57
↓ 1 callersMethod_init_browser
初始化浏览器
源代码/爬虫进阶/11_进阶综合实战项目/crawler/spider.py:113
↓ 1 callersMethod_init_client
初始化 API 客户端
源代码/爬虫进阶/11_进阶综合实战项目/crawler/spider.py:159
↓ 1 callersMethod_need_check
是否需要检测
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/cookie_manager.py:323
↓ 1 callersMethod_notify_status
通知状态变化
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/bilibili_qrcode_login.py:165
↓ 1 callersMethod_parse_duration
解析时长字符串为秒数 Args: duration_str: 时长字符串,如 "3:45" 或 "1:23:45" Returns: int: 时长(秒)
源代码/爬虫进阶/11_进阶综合实战项目/models/bilibili.py:221
↓ 1 callersMethod_poll_result
轮询获取结果
源代码/爬虫进阶/08_验证码识别与处理/captcha_service.py:113
↓ 1 callersMethod_refresh_loop
后台刷新循环
源代码/爬虫进阶/03_代理IP的使用与管理/proxy_pool/pool.py:105
↓ 1 callersMethod_save_cookies
保存 Cookie
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:394
↓ 1 callersMethod_search_single_keyword
搜索单个关键词 Args: keyword: 搜索关键词
源代码/爬虫进阶/11_进阶综合实战项目/crawler/spider.py:190
↓ 1 callersMethod_show_qrcode
显示二维码 优先使用 PIL 显示,如果不可用则保存到文件。 Args: qrcode_base64: Base64 编码的二维码图片
源代码/爬虫进阶/11_进阶综合实战项目/login/auth.py:333
↓ 1 callersMethod_try_load_cookies
尝试加载 Cookie
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:378
↓ 1 callersMethod_validate
验证 Cookie 是否有效
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/cookie_manager.py:330
↓ 1 callersMethodacquire
获取并发许可
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/rate_limiter.py:212
↓ 1 callersMethodadd_proxy
添加单个代理
源代码/爬虫进阶/11_进阶综合实战项目/proxy/pool.py:117
↓ 1 callersMethodasync_init
(self)
源代码/爬虫入门/10_爬虫入门实战3_数据存储实现/async_db.py:112
↓ 1 callersFunctionbasic_usage
基础用法演示
源代码/爬虫进阶/01_工程化爬虫开发规范/logger_demo.py:9
↓ 1 callersMethodbegin
开始登录流程 根据 login_type 自动选择登录方式。 Returns: bool: 登录是否成功
源代码/爬虫进阶/11_进阶综合实战项目/login/auth.py:123
↓ 1 callersMethodbinarize
二值化 Args: image_bytes: 图片字节 threshold: 阈值 (0-255),小于阈值变黑,大于变白 Returns: 处理后的图片字节
源代码/爬虫进阶/08_验证码识别与处理/ocr_captcha.py:48
↓ 1 callersMethodbuild_ajax_headers
构建传统 AJAX 请求头 Args: referer: Referer 地址 x_requested_with: 是否添加 X-Requested-With 头 Returns:
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/headers_builder.py:126
↓ 1 callersMethodbuild_mobile_headers
构建移动端请求头 Args: referer: Referer 地址 extra_headers: 额外的请求头 Returns: 移动端请求头字典
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/headers_builder.py:148
↓ 1 callersFunctioncheck_from_file
从文件读取代理并检测 Args: filepath: 代理列表文件路径(每行一个代理) Returns: 可用的代理列表
源代码/爬虫进阶/03_代理IP的使用与管理/proxy_checker.py:101
↓ 1 callersFunctioncheck_single_proxy
检测单个代理 Args: proxy_str: 代理字符串,格式为 host:port 或 protocol://host:port Returns: 代理是否可用
源代码/爬虫进阶/03_代理IP的使用与管理/proxy_checker.py:17
↓ 1 callersMethodclean
执行完整的文本清洗 Args: text: 原始文本 Returns: 清洗后的文本
源代码/爬虫进阶/09_数据清洗与预处理/text_cleaner.py:369
↓ 1 callersMethodcleanup
清理资源
源代码/爬虫进阶/01_工程化爬虫开发规范/refactored_crawler/crawler.py:132
↓ 1 callersMethodclear
清空代理池
源代码/爬虫进阶/11_进阶综合实战项目/proxy/pool.py:191
↓ 1 callersMethodclear_cookies
清除 Cookie
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:409
↓ 1 callersFunctioncli
命令行入口
源代码/爬虫进阶/11_进阶综合实战项目/main.py:218
↓ 1 callersMethodclose
关闭浏览器
源代码/爬虫进阶/11_进阶综合实战项目/crawler/spider.py:292
↓ 1 callersMethodclose
关闭浏览器
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/qrcode_login.py:128
↓ 1 callersMethodclose
关闭爬虫
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/session_demo.py:70
↓ 1 callersMethodclose
关闭爬虫
源代码/爬虫进阶/02_反爬虫对抗基础_请求伪装/anti_detection_crawler.py:106
↓ 1 callersFunctioncontext_logging
上下文日志
源代码/爬虫进阶/01_工程化爬虫开发规范/logger_demo.py:94
↓ 1 callersMethodcrawl_all_pages
爬取所有页面 Args: max_pages: 最大页数 Returns: 所有名言列表
源代码/爬虫进阶/04_Playwright浏览器自动化入门/spa_crawler.py:113
↓ 1 callersFunctioncrawl_page
爬取单个页面的示例 - 展示异常处理最佳实践
源代码/爬虫进阶/01_工程化爬虫开发规范/exception_demo.py:155
↓ 1 callersMethodcrawl_page
爬取单页数据 Args: page_num: 页码 Returns: 名言列表
源代码/爬虫进阶/04_Playwright浏览器自动化入门/spa_crawler.py:72
↓ 1 callersFunctioncrawler_logging_example
爬虫场景的日志使用示例
源代码/爬虫进阶/01_工程化爬虫开发规范/logger_demo.py:134
↓ 1 callersMethodcreate_qrcode_login
创建扫码登录
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:253
↓ 1 callersMethodcreate_sms_login
创建短信登录
源代码/爬虫进阶/07_登录认证_扫码与短信登录实现/login_factory.py:268
↓ 1 callersFunctioncustom_format
自定义日志格式
源代码/爬虫进阶/01_工程化爬虫开发规范/logger_demo.py:23
↓ 1 callersMethoddecode_entities
解码 HTML 实体 Args: text: 包含 HTML 实体的文本 Returns: 解码后的文本
源代码/爬虫进阶/09_数据清洗与预处理/text_cleaner.py:74
↓ 1 callersMethoddedupe_dicts_by_field
根据单个字段去重 Args: items: 字典列表 key_field: 用于去重的字段名 Returns: 去重后的列表
源代码/爬虫进阶/09_数据清洗与预处理/deduplication.py:32
↓ 1 callersMethoddedupe_fuzzy
模糊去重 Args: items: 字符串列表 threshold: 相似度阈值 (0.0 - 1.0) similarity_func: 相似度算法 (levenshtein/jaccard
源代码/爬虫进阶/09_数据清洗与预处理/deduplication.py:200
↓ 1 callersMethoddedupe_list
列表去重(保持顺序) Args: items: 字符串列表 Returns: 去重后的列表
源代码/爬虫进阶/09_数据清洗与预处理/deduplication.py:13
↓ 1 callersFunctiondemo
演示文本清洗功能
源代码/爬虫进阶/09_数据清洗与预处理/text_cleaner.py:410
↓ 1 callersFunctiondemo
去重工具演示
源代码/爬虫进阶/09_数据清洗与预处理/deduplication.py:397
↓ 1 callersFunctiondemo
数据标准化演示
源代码/爬虫进阶/09_数据清洗与预处理/data_normalizer.py:413
↓ 1 callersFunctiondemo
演示 Cookie 管理器的使用
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/cookie_manager.py:370
↓ 1 callersFunctiondemo
演示登录状态检测
源代码/爬虫进阶/06_登录认证_Cookie与Session管理/login_state_checker.py:324
↓ 1 callersFunctiondemo
验证码服务演示
源代码/爬虫进阶/08_验证码识别与处理/captcha_service.py:324
↓ 1 callersFunctiondemo
滑块验证码处理演示
源代码/爬虫进阶/08_验证码识别与处理/slider_captcha.py:399
↓ 1 callersFunctiondemo
演示 OCR 验证码识别
源代码/爬虫进阶/08_验证码识别与处理/ocr_captcha.py:280
↓ 1 callersFunctiondemo
演示词云生成功能
源代码/爬虫进阶/10_数据分析与可视化/wordcloud_generator.py:346
↓ 1 callersFunctiondemo
演示图表生成功能
源代码/爬虫进阶/10_数据分析与可视化/chart_demo.py:515
← previousnext →101–200 of 724, ranked by callers