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

Python 爬虫抓取 Ajax 动态评论

  •  
  •   buxiangshuo · Mar 20, 2014 · 9420 views
    This topic created in 4617 days ago, the information mentioned may be changed or developed.
    http://comment5.news.sina.com.cn/comment/skin/default.html?channel=gn&newsid=1-1-29714243

    通过chrome控制台简单粗暴得到json数据url,但是只能得到有限的评论。新浪新闻的评论都是动态加载的,不懂ajax也不太明白如何模拟header头,第一次写爬虫,真心累觉不爱啊,请哪位大神帮帮忙看下如何解决?最好详细一点,本人这方面小白一个 = _ =||

    不胜感激!!!
    10 replies  •  2017-07-11 09:06:10 +08:00
    binux
    binux
    Mar 20, 2014❤️2
    1
    不懂就去弄懂
    zoowii
    zoowii
    Mar 20, 2014
    2
    Google
    wangfengmadking
    wangfengmadking
    Mar 20, 2014
    3
    selenium或者PhantomJS都可以解决你的问题
    yanpeipan
    yanpeipan
    Mar 20, 2014
    4
    python+selenium+PhantomJS
    Livid
    Livid
    MOD
    PRO
    Mar 20, 2014 via iPhone❤️2
    5
    import requests

    headers = { ... }
    url = ...
    r = requests.get(url, headers=headers)
    buxiangshuo
    buxiangshuo
    OP
    Mar 20, 2014
    6
    感谢大家!问题已经解决啦~
    s51431980
    s51431980
    Mar 20, 2014
    7
    @buxiangshuo 楼主怎么解决的,介绍一下思路?
    zxc337
    zxc337
    Mar 20, 2014
    8
    怎么解决的,发我看看
    keven
    keven
    Mar 26, 2014
    9
    解决了公布一下解决方式呗,ajax不难的,我做采集很多,用工具直接搞定
    ikeeper
    ikeeper
    Jul 11, 2017
    10
    帖主咋弄的,求指教啊,捣鼓半天发现 js 请求后面跟了一个随机数,不知道怎么继续了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4090 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 06:49 · PVG 14:49 · LAX 22:49 · JFK 01:49
    ♥ Do have faith in what you're doing.