V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
JoryJoestar
V2EX  ›  Python

有没有爬虫王!可以教下我 Websocket 怎么爬吗?

  •  
  •   JoryJoestar · 45 天前 · 5496 次点击
    这是一个创建于 45 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想要爬的网站: https://crushon.ai/character/7e388767-63c7-45e3-b922-53458b4ae4f7/chat

    一直请求 403 ,难受,搞不定,用无头 playwrihgt ,又不过 cloudflare ,请求又被拒绝,难搞!

    想请教一下 v2 的各位佬,怎么爬这个网站聊天对话。

    30 条回复    2025-08-15 09:50:24 +08:00
    peteretep
        1
    peteretep  
       45 天前   ❤️ 23
    你应该发到程序员版面 《恕我直言,用 websocket 发送对话,根本没有人能爬到我的内容 》
    lisxour
        2
    lisxour  
       45 天前   ❤️ 1
    你发外包我可以接
    irrigate2554
        3
    irrigate2554  
       45 天前
    看你这个描述,不是卡在 ws 而是卡在过不了 cf
    cbythe434
        4
    cbythe434  
       45 天前
    有头手工点 cloudflare
    evan1
        5
    evan1  
    PRO
       45 天前
    我有个办法,别用无头,用有头。手动过下 cf ,然后程序自动爬。
    rabbbit
        6
    rabbbit  
       45 天前
    NSFW 警告,不要看首页
    coderzhangsan
        7
    coderzhangsan  
       45 天前
    😮,websocket 也能爬?如果能爬,那基于 TCP 协议的应该都能爬吧?
    foufoufm
        8
    foufoufm  
       45 天前
    @peteretep 今日 funning
    musi
        9
    musi  
       45 天前
    用 electron 开 cdp 监听 ws
    xiaoming1992
        10
    xiaoming1992  
       45 天前 via Android
    @rabbbit 你跟我看的是一个首页吗?哪有 NSFW ,都是穿得严严实实的印度大妈和卡通人物
    dreamkuo
        11
    dreamkuo  
       45 天前
    @peteretep 太经典了. 太厉害了. 赔付
    dreamkuo
        12
    dreamkuo  
       45 天前
    @peteretep 佩服 你是懂发帖的
    march1993
        13
    march1993  
       45 天前
    用 chrome 打开,然后打开 inspector network 页,右键复制 curl(cmd/bash),这种基本可以下载下来
    lyusantu
        14
    lyusantu  
       45 天前
    @xiaoming1992 你登录了吗
    lyusantu
        15
    lyusantu  
       45 天前
    @xiaoming1992 登录解锁
    JoryJoestar
        16
    JoryJoestar  
    OP
       45 天前
    @peteretep 你是懂程序员的
    JoryJoestar
        17
    JoryJoestar  
    OP
       45 天前
    @musi 我试试,谢谢🙏
    249239432
        18
    249239432  
       45 天前
    @coderzhangsan 看页面源代码解析逻辑,可以爬
    drymonfidelia
        19
    drymonfidelia  
       45 天前
    @coderzhangsan 不能爬网站是怎么显示的?你能看到的东西都能爬
    991547436
        20
    991547436  
       45 天前
    playwright 这样过 cf
    Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setHeadless(true)
    .setArgs(List.of("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"))
    );
    testliyu
        21
    testliyu  
       45 天前
    @peteretep 你是懂拿捏人心理的
    alexchen7
        22
    alexchen7  
       45 天前
    建议你看看 browser use 项目。
    TophTab
        24
    TophTab  
       44 天前   ❤️ 1
    @peteretep #1 《提问的艺术》
    ooTwToo
        25
    ooTwToo  
       44 天前
    指纹浏览器
    ShineyWang
        26
    ShineyWang  
       41 天前
    huangpingdong
        27
    huangpingdong  
       39 天前
    @peteretep 怎么大胆,抖音弹幕都有人能爬 websocket 加密的还是
    huangpingdong
        28
    huangpingdong  
       39 天前
    @peteretep 怎么大胆,抖音弹幕都有人能爬 websocket 加密的
    JoryJoestar
        29
    JoryJoestar  
    OP
       38 天前
    @991547436 牛的
    JoryJoestar
        30
    JoryJoestar  
    OP
       38 天前
    搞定了,用的有头 playwright ,手动过 cloudflare ,还可以吧,只需要确认一次就行
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2271 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:56 · PVG 23:56 · LAX 08:56 · JFK 11:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.