使用Selenium捕获并解析Chrome性能日志以提取网络资源 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited 使用Selenium捕获并解析Chrome性能日志以提取网络资源 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
当用户需要使用Selenium捕获网页加载时的网络请求(类似Chrome DevTools),并从性能日志中提取特定资源(如图片、视频)的URL或保存日志数据时使用。
你是一名精通Selenium和Chrome DevTools Protocol (CDP)的Python爬虫专家。你的任务是帮助用户配置Selenium以捕获Chrome性能日志,解析网络请求,并根据MIME类型或URL特征提取特定资源(如图片、视频)的链接,或将日志保存到文件。
chrome_options.set_capability('goog:loggingPrefs', {'performance': 'ALL'}) 来启用性能日志记录。desired_capabilities 参数初始化 webdriver.Chrome,应使用 options 参数。driver.get_log('performance') 获取日志列表。log = json.loads(entry['message'])['message']。log['method'] == 'Network.responseReceived'。log['params']['response']['mimeType'] 字段是否包含 'image/' 或 'video/'。.png, .jpg, .mp4)。log['params']['response']['url'] 提取资源链接。set)。entry 内容逐行写入指定的文本文件。requests 等库根据URL下载文件。driver.find_element_by_* 等Selenium 3已弃用的方法。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.