推荐学习书目
› 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 · 2905 views
    This topic created in 2848 days ago, the information mentioned may be changed or developed.

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

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