coolair
V2EX  ›  问与答

请问下 selenium 调 geckodriver(Firefox)headless 爬网页,很慢啊,基本一秒多一页,有什么办法提高速度吗?

  •  
  •   coolair · Sep 20, 2018 · 2193 views
    This topic created in 2817 days ago, the information mentioned may be changed or developed.
    3 replies    2018-09-20 14:10:40 +08:00
    Nostalgiaaaa
        1
    Nostalgiaaaa  
       Sep 20, 2018
    这种从根本上来说就不会快吧。。。试试不加载 js,图片这些?
    darksand
        2
    darksand  
       Sep 20, 2018
    不用 selelnium/增加并发 /分布式
    simonliu2018
        3
    simonliu2018  
       Sep 20, 2018
    1 楼的思路可以试试,如果 JS 不能禁掉,可以试试把图片,样式表禁掉。

    我以前尝试过 scrapy-splash,这个比 selenium 快。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2906 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 00:29 · PVG 08:29 · LAX 17:29 · JFK 20:29
    ♥ Do have faith in what you're doing.