推荐学习书目
› 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
ArtCell
V2EX  ›  Python

requests 库爬取网页时遇到 jQuery 的 val 函数设置的 Input 标签,无法获取 input 值

  •  1
     
  •   ArtCell · Jan 26, 2019 · 2870 views
    This topic created in 2827 days ago, the information mentioned may be changed or developed.

    如题,有没有其他的方法能够获取

    5 replies  •  2019-01-27 15:10:14 +08:00
    zhouzheng
        1
    zhouzheng  
       Jan 26, 2019   ❤️ 1
    Selenium+firefox,这个方案比较麻烦,爬起来也比较慢,但是可以解决所有 js 事件加载等问题。
    ArtCell
        2
    ArtCell  
    OP
       Jan 26, 2019
    @zhouzheng 感谢
    rekulas
        3
    rekulas  
       Jan 26, 2019
    我觉得 headless chrome 更好用些,不过如果页面不复杂的话,分析一下对方如何获取和设置数据的直接抓数据来源是最简单的。 基本的元素分析能力是爬虫工程师必备。
    xiaozizayang
        4
    xiaozizayang  
       Jan 26, 2019
    自写的框架 https://github.com/howie6879/ruia,支持 js 加载 你可以试试
    skinny
        5
    skinny  
       Jan 27, 2019
    Chrome 有一些奇奇怪怪的问题,比如截图有 Bug,还是 Firefox 稳定些。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2976 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:44 · PVG 11:44 · LAX 20:44 · JFK 23:44
    ♥ Do have faith in what you're doing.