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
pythonee
V2EX  ›  Python

python 能不能通过 ie 或 chrome 来抓取渲染好的网页

  •  
  •   pythonee · 2014-02-13 00:10:49 +08:00 · 5246 次点击
    这是一个创建于 3730 天前的主题,其中的信息可能已经有所发展或是发生改变。
    通过urllib2或是requests来get页面,只是抓取了html源码,css渲染效果和ajax调用都没有,所以,我在想是不是可以通过ie或chrome来抓取在浏览器上看到的效果呢
    14 条回复    1970-01-01 08:00:00 +08:00
    OhmyCaptain
        1
    OhmyCaptain  
       2014-02-13 00:15:04 +08:00
    selenium?
    iloahz
        2
    iloahz  
       2014-02-13 00:20:27 +08:00
    貌似现在能模拟浏览器渲染的就只有1L说这个吧
    txlty
        3
    txlty  
       2014-02-13 00:37:44 +08:00
    est
        4
    est  
       2014-02-13 01:08:17 +08:00
    IE可以。win32com
    otakustay
        5
    otakustay  
       2014-02-13 01:36:02 +08:00
    phantomjs和真chrome的差距还是有点的,真要抓就用selenium吧,除了效率低下外没啥缺点
    manhere
        6
    manhere  
       2014-02-13 02:10:03 +08:00
    如果是win平台的话,有个命令行版网页截图工具,很好用
    zhouzm
        7
    zhouzm  
       2014-02-13 08:19:02 +08:00
    cefpython
    simapple
        8
    simapple  
       2014-02-13 08:45:24 +08:00
    python Qt webkit
    ksc010
        9
    ksc010  
       2014-02-13 09:12:45 +08:00
    phantomjs + casperjs
    PurpleSun
        10
    PurpleSun  
       2014-02-13 10:10:32 +08:00
    *nix平台:whhtmltopdf + pdfkit
    josephshen
        11
    josephshen  
       2014-02-13 10:33:27 +08:00
    http://cutycapt.sourceforge.net/
    然后自己再包装一个python接口就行
    gonjay
        12
    gonjay  
       2014-02-13 12:59:39 +08:00
    用Chrome插件直接用js来抓取,再通过ajax给自己的数据库存起来?
    pythonee
        13
    pythonee  
    OP
       2014-02-25 09:26:54 +08:00
    @gonjay 我是想做成daemon定期去抓的,不想起来一个chrome
    keven
        14
    keven  
       2014-03-26 00:20:15 +08:00
    python应该有相关的库或者可以直接利用的东西吧,我也在抓数据,八爪鱼采集器就是内置了一个浏览器,然后通过浏览器来进行采集的。所以ajax这些肯定是支持的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2236 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:17 · PVG 19:17 · LAX 04:17 · JFK 07:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.