Files
Obsidian/MyBestNanobot/Nanobot安装了Chromium之后能做啥.md
coco 8b94d76799 a
2026-07-21 13:57:15 +08:00

126 lines
3.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
基于你现有的项目和配置,Chromium 可以帮你做这些:
国内云端服务器如何安装 chromium-browser chromium
# 备份原源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 替换为清华源(Ubuntu 20.04/22.04/24.04 通用)
sudo tee /etc/apt/sources.list <<-'EOF'
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse
EOF
sudo apt update -y
---
## **🎯 立即可用的功能**
### **1. 修复热点抓取脚本**(最实用)
掘金、知乎等网站的页面结构变了,需要更新选择器:
```bash
cd ~/nanocode/playwright-hotspots
# 更新选择器后重新抓取
npm run juejin
npm run zhihu
npm run weibo
```
### **2. 小红书数据采集**
配合已有的小红书能力,可以:
- 抓取搜索结果页面
- 下载笔记图片/视频
- 监控特定话题热度
### **3. 网站截图**
```javascript
// 给文章生成封面图、保存页面证据
const { chromium } = require('playwright');
const browser = await chromium.launch({executablePath: '/usr/bin/chromium-browser'});
// 截图保存
```
---
## **📊 可以开发的新功能**
| 场景 | 用途 | 示例 |
|------|------|------|
| **每日资讯聚合** | 自动抓取多个平台热点,生成日报 | 掘金+知乎+微博+头条 |
| **竞品监控** | 监控对手网站更新 | 价格变动、新功能上线 |
| **SEO检查** | 定期抓取网站,检测死链/性能 | 网站健康度报告 |
| **自动化测试** | 测试你的 Web 应用 | wanandroid 项目测试 |
| **PDF生成** | 将网页转为PDF存档 | 公众号文章备份 |
---
## **🚀 推荐:热点日报自动化**
结合你已部署的系统,可以打造一个**自动热点追踪系统**:
```
每天定时任务
├─ 10:00 抓取科技热点 → 生成小红书文案
├─ 16:00 抓取IT资讯 → 生成小红书文案
└─ 新增:抓取掘金/知乎 → 生成公众号选题
```
需要我帮你:
1. **更新掘金/知乎的选择器**,让热点抓取恢复正常?
2. **创建一个热点日报脚本**,自动抓取多个平台?
3. **测试其他具体功能**?
你想先做什么?🐈
---
## **✅ 修复完成!所有平台恢复正常**
| 平台 | 状态 | 抓取数量 |
|------|------|----------|
| **掘金** | ✅ 已修复 | 49 条文章 |
| **知乎** | ✅ 正常 | 30 条热榜 |
| **微博** | ✅ 正常 | 50 条热搜 |
| **B站** | ✅ 正常 | 10 条热门 |
---
### **🔧 修复内容**
**掘金 (juejin.js)**:
- 原选择器已失效(`.article-item .title-row a` 等)
- 新选择器:`'a[href*="/post/"]'` - 直接匹配文章链接
- 新增:去重、标题清理、过滤无效数据
---
### **💾 数据保存位置**
```bash
~/nanocode/playwright-hotspots/data/
├── juejin_2026-03-28T11-58-32-838Z.json
├── zhihu_2026-03-28T11-58-43-269Z.json
├── weibo_2026-03-28T11-58-51-985Z.json
└── bilibili_2026-03-28T11-58-56-293Z.json
```
---
### **🚀 现在可以做什么**
```bash
# 抓取单一平台
npm run juejin # 掘金热门
npm run zhihu # 知乎热榜
npm run weibo # 微博热搜
npm run bilibili # B站热门
# 抓取全部
npm run all # 所有平台
```
需要我帮你**创建一个综合热点日报脚本**,自动抓取多平台并生成汇总吗?🐈