有没有爬虫王!可以教下我 Websocket 怎么爬吗? - V2EX
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 130 天前 6141 次点击
    这是一个创建于 130 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想要爬的网站: 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  
       130 天前   23
    你应该发到程序员版面 《恕我直言,用 websocket 发送对话,根本没有人能爬到我的内容 》
    lisxour
        2
    lisxour  
       130 天前   1
    你发外包我可以接
    irrigate2554
        3
    irrigate2554  
       130 天前
    看你这个描述,不是卡在 ws 而是卡在过不了 cf
    cbythe434
        4
    cbythe434  
       130 天前
    有头手工点 cloudflare
    evan1
        5
    evan1  
    PRO
       130 天前
    我有个办法,别用无头,用有头。手动过下 cf ,然后程序自动爬。
    rabbbit
        6
    rabbbit  
       130 天前
    NSFW 警告,不要看首页
    coderzhangsan
        7
    coderzhangsan  
       130 天前
    ,websocket 也能爬?如果能爬,那基于 TCP 协议的应该都能爬吧?
    foufoufm
        8
    foufoufm  
       130 天前
    @peteretep 今日 funning
    musi
        9
    musi  
       130 天前
    用 electron 开 cdp 监听 ws
    xiaoming1992
        10
    xiaoming1992  
       130 天前 via Android
    @rabbbit 你跟我看的是一个首页吗?哪有 NSFW ,都是穿得严严实实的印度大妈和卡通人物
    dreamkuo
        11
    dreamkuo  
       130 天前
    @peteretep 太经典了. 太厉害了. 赔付
        12
    dreamkuo  
       130 天前
    @peteretep 佩服 你是懂发帖的
    march1993
        13
    march1993  
       130 天前
    用 chrome 打开,然后打开 inspector network 页,右键复制 curl(cmd/bash),这种基本可以下载下来
    lyusantu
        14
    lyusantu  
       130 天前
    @xiaoming1992 你登录了吗
    lyusantu
        15
    lyusantu  
       130 天前
    @xiaoming1992 登录解锁
    JoryJoestar
        16
    JoryJoestar  
    OP
       130 天前
    @peteretep 你是懂程序员的
    JoryJoestar
        17
    JoryJoestar  
    OP
       130 天前
    @musi 我试试,谢谢
    249239432
        18
    249239432  
       130 天前
    @coderzhangsan 看页面源代码解析逻辑,可以爬
    drymonfidelia
        19
    drymonfidelia  
       130 天前
    @coderzhangsan 不能爬网站是怎么显示的?你能看到的东西都能爬
    991547436
        20
    991547436  
       130 天前
    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  
       130 天前
    @peteretep 你是懂拿捏人心理的
    alexchen7
        22
    alexchen7  
       130 天前
    建议你看看 browser use 项目。
    TophTab
        24
    TophTab  
       129 天前   1
    @peteretep #1 《提问的艺术》
    ooTwToo
        25
    ooTwToo  
       129 天前
    指纹浏览器
    ShineyWang
        26
    ShineyWang  
       126 天前
    huangpingdong
        27
    huangpingdong  
       124 天前
    @peteretep 怎么大胆,抖音弹幕都有人能爬 websocket 加密的还是
    huangpingdong
        28
    huangpingdong  
       124 天前
    @peteretep 怎么大胆,抖音弹幕都有人能爬 websocket 加密的
    JoryJoestar
        29
    JoryJoestar  
    OP
       123 天前
    @991547436 牛的
    JoryJoestar
        30
    JoryJoestar  
    OP
       123 天前
    搞定了,用的有头 playwright ,手动过 cloudflare ,还可以吧,只需要确认一次就行
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1091 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 29ms UTC 18:13 PVG 02:13 LAX 10:13 JFK 13:13
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86