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

抓取 taobao 页面的商品评价,但 html 里没有?

  •  
  •   sean718 · 2014-12-23 09:20:38 +08:00 · 4134 次点击
    这是一个创建于 3422 天前的主题,其中的信息可能已经有所发展或是发生改变。
    “商品评价”需要点一下才出现所有买家的评价内容。
    直接查看网页源代码是没有的。
    例如这个页面:
    http://detail.tmall.com/item.htm?spm=a1z10.1.w5003-4312061082.1.tcCd0A&id=22388452571&rn=838b6fff91da5336ec2903da71c42ce5&scene=taobao_shop
    上面的页面里,“累计评价”只有鼠标点一下才显示里面的内容。
    因此如何得到评价里的内容?
    没有做过web,请问这是动态网页吗?是什么技术?
    4 条回复    2014-12-26 14:43:07 +08:00
    taogogo
        1
    taogogo  
       2014-12-23 10:31:10 +08:00
    phantomjs
    fighter2011
        2
    fighter2011  
       2014-12-23 11:08:36 +08:00 via Android
    json给的数据
    pc10201
        3
    pc10201  
       2014-12-24 19:36:54 +08:00
    抓包然后模拟~
    sean718
        4
    sean718  
    OP
       2014-12-26 14:43:07 +08:00
    各位,我看了一下这个”累计评价“的源码,如下:
    <li>
    <a class="tb-tab-anchor"
    href="javascript:void(0);"
    hidefocus="true"
    data-index="1"
    data-spm-click="gostr=/tbdetail;locaid=d2"
    shortcut-key="g c"
    shortcut-label="查看累计评论"
    shortcut-effect="click">
    累计评论
    <em class="J_ReviewsCount">0</em>
    </a>

    <div class="tb-selected-indicator"></div>
    </li>

    这个链接没有onclick函数,那点击它之后怎么去找它调用的函数呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1435 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:48 · PVG 07:48 · LAX 16:48 · JFK 19:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.