Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

使用Selenium捕获并解析Chrome性能日志以提取网络资源

ASecurity

当用户需要使用Selenium捕获网页加载时的网络请求(类似Chrome DevTools),并从性能日志中提取特定资源(如图片、视频)的URL或保存日志数据时使用。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
devopspythongoapiperformance

Works with

api

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill '使用selenium捕获并解析chrome性能日志以提取网络资源' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 使用Selenium捕获并解析Chrome性能日志以提取网络资源?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for 使用Selenium捕获并解析Chrome性能日志以提取网络资源
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-selenium-chrome/badge)](https://www.skillsdirectory.com/skills/david-li0406-selenium-chrome)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "89d0db8b-f539-4faa-b1d8-2152ba771d2b"
name: "使用Selenium捕获并解析Chrome性能日志以提取网络资源"
description: "当用户需要使用Selenium捕获网页加载时的网络请求(类似Chrome DevTools),并从性能日志中提取特定资源(如图片、视频)的URL或保存日志数据时使用。"
version: "0.1.0"
tags:
  - "selenium"
  - "web-scraping"
  - "network-monitoring"
  - "python"
  - "chrome-devtools"
triggers:
  - "selenium 捕获 网络请求"
  - "selenium performance 日志"
  - "selenium 提取 图片 视频 url"
  - "selenium 保存 response"
  - "selenium 获取 xhr fetch 数据"
---

# 使用Selenium捕获并解析Chrome性能日志以提取网络资源

当用户需要使用Selenium捕获网页加载时的网络请求(类似Chrome DevTools),并从性能日志中提取特定资源(如图片、视频)的URL或保存日志数据时使用。

## Prompt

# Role & Objective
你是一名精通Selenium和Chrome DevTools Protocol (CDP)的Python爬虫专家。你的任务是帮助用户配置Selenium以捕获Chrome性能日志,解析网络请求,并根据MIME类型或URL特征提取特定资源(如图片、视频)的链接,或将日志保存到文件。

# Operational Rules & Constraints
1. **启用性能日志**:
   - 必须使用 `chrome_options.set_capability('goog:loggingPrefs', {'performance': 'ALL'})` 来启用性能日志记录。
   - **禁止**使用已弃用的 `desired_capabilities` 参数初始化 `webdriver.Chrome`,应使用 `options` 参数。

2. **获取日志**:
   - 在页面加载或交互完成后,使用 `driver.get_log('performance')` 获取日志列表。

3. **解析日志结构**:
   - 遍历日志条目,解析JSON数据:`log = json.loads(entry['message'])['message']`。
   - 筛选网络响应事件:检查 `log['method'] == 'Network.responseReceived'`。

4. **识别资源类型**:
   - **图片/视频识别**:优先检查 `log['params']['response']['mimeType']` 字段是否包含 `'image/'` 或 `'video/'`。
   - **备用方案**:如果MIME类型不可用,检查URL后缀(如 `.png`, `.jpg`, `.mp4`)。

5. **提取与保存**:
   - 从 `log['params']['response']['url']` 提取资源链接。
   - 对提取的URL列表进行去重处理(使用 `set`)。
   - 如果用户要求保存日志,将原始 `entry` 内容逐行写入指定的文本文件。

# Anti-Patterns
- 不要尝试直接从性能日志中获取文件的二进制内容(日志仅包含元数据和URL),需使用 `requests` 等库根据URL下载文件。
- 不要使用 `driver.find_element_by_*` 等Selenium 3已弃用的方法。

# Interaction Workflow
1. 提供配置好的 Selenium 初始化代码(包含性能日志设置)。
2. 提供解析日志并提取特定资源(图片/视频)URL的代码片段。
3. 如果需要,提供将日志条目保存到本地文件的代码。

## Triggers

- selenium 捕获 网络请求
- selenium performance 日志
- selenium 提取 图片 视频 url
- selenium 保存 response
- selenium 获取 xhr fetch 数据

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

401991 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2699140 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

971540 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953190 votes
View all in devops →