NanmiCoder / NanmiCoder/MediaCrawler
[问题] wsl无法指定主机浏览器为custom browser
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 65.3k
- Forks
- 12.6k
- PR merge metrics
- No merged PRs in 30d
Description
⚠️ 提交前确认
- 我已经仔细阅读了项目使用过程中的常见问题汇总
- 我已经搜索并查看了已关闭的issues
- 我确认这不是由于滑块验证码、Cookie过期、Cookie提取错误、平台风控等常见原因导致的问题
❓ 问题描述
指定CUSTOM_BROWSER_PATH = "/mnt/c/Program\ Files\ \(x86\)/Microsoft/Edge/Application/msedge.exe", wsl配置了相同的/usr/bin下默认浏览器的软链接,功能上可以确保终端ctrl+单击可以在本机浏览器打开网页,但是启用cdp模式,找不到可用浏览器。
此时会通过wsl打开默认配置浏览器,但中文字体全都无法显示,是我wsl打开各类窗口的老毛病。(同时也会在我本机启动一个新的edge窗口,但是仅仅是启动了,没有使用它)
其实是可以正常登录使用的,但是wsl窗口有响应慢等使用上的不便,所以希望尝试改用本机浏览器。
(之所以不直接本机,是因为用powershell运行,未知原因无法连接到小红书的edith api,提示http 400,以及本机ps也有其他遗留的使用问题)
🔍 使用场景
- 目标平台: 小红书
- 使用功能: 用户笔记图片爬取(启用浏览器时)
💻 环境信息
- 操作系统: wsl2, Ubuntu 22.04 x86_64
- Python版本: 3.11
- 是否使用IP代理: wsl配置使用主机clash proxy
- 是否使用VPN翻墙软件:使用clash Allow LAN功能,并未使用VPN
- 目标平台(抖音/小红书/微博等): 小红书
📋 错误日志
(crawl) ➜ MediaCrawler git:(main) ✗ uv run main.py
2025-09-26 15:11:49 MediaCrawler INFO (core.py:65) - [XiaoHongShuCrawler] 使用CDP模式启动浏览器
2025-09-26 15:11:49 MediaCrawler ERROR (cdp_browser.py:67) - [CDPBrowserManager] CDP浏览器启动失败: 未找到可用的浏览器。请确保已安装Chrome或Edge浏览器,或在配置文件中设置CUSTOM_BROWSER_PATH指定浏览器路径。
2025-09-26 15:11:49 MediaCrawler ERROR (core.py:417) - [XiaoHongShuCrawler] CDP模式启动失败,回退到标准模式: 未找到可用的浏览器。请确保已安装Chrome或Edge浏览器,或在配置文件中设置CUSTOM_BROWSER_PATH指定浏览器路径。
2025-09-26 15:11:49 MediaCrawler INFO (core.py:369) - [XiaoHongShuCrawler.launch_browser] Begin create browser context ...
📷 错误截图
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The failure is logged in cdp_browser.py:67 and the fallback in core.py:417; start by tracing browser discovery and CUSTOM_BROWSER_PATH handling under WSL2 Ubuntu. Reproduce with uv run main.py and the reported Edge path, then verify the selected host browser accepts the CDP connection. Done means CDP mode starts without fallback and the Xiaohongshu image crawl works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, ubuntu
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100