Groups
Groups
Sign in
Groups
Groups
童言无忌
Conversations
Labels
About
Send feedback
Help
网易 163.com 读者评论批量下载方法
1 view
Skip to first unread message
lihlii
unread,
Mar 6, 2013, 9:02:09 PM
3/6/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to posterous, lihlii-g
经分析其网页脚本,得知其网页评论数据以 JavaScript JSON 格式保存,其数据可以通过如下变量保存的网址获得:
postType: quote, reply, quickPost
评论网页网址格式:
commentPage : "
http://
<#=host#>/<#=boardId#>/<#=threadId#>.html"
原始 JSON 数据网址格式:
newDataSrc : "/cache/newlist/<#=boardId#>/<#=threadId#>_<#=page#>.html",
dataSrc : "/data/<#=boardId#>/<#=type#>/<#=threadId#>_<#=page#>.html",
例如:
对于评论网页
http://comment.news.163.com/news_guonei8_bbs/8IVFIJGL0001124J.html
其 JSON 原始数据第1页和第39页的网址是:
http://comment.news.163.com/cache/newlist/news_guonei8_bbs/8IVFIJGL0001124J_1.html
http://comment.news.163.com/cache/newlist/news_guonei8_bbs/8IVFIJGL0001124J_39.html
对于网页
http://comment.news.163.com/photoview_bbs/PHOT0VKV000100AO.html
其第1页 JSON 原始数据的 newDataSrc 网址为:
http://comment.news.163.com/cache/newlist/photoview_bbs/PHOT0VKV000100AO_1.html
如下网址获取的可能是热门评论,dataSrc 网址格式:
http://comment.news.163.com/data/photoview_bbs/df/PHOT0VKV000100AO_1.html
可以用 FreeDownloadManager 的 Create batch download 批量下载功能,自动下载的所有页评论原始数据:
下载完成后,得到的 HTML 文件其实内容是包含 JSON 数据的 JavaScript。可以用本文附带的 json_merge_htm.bat 将其合并转换为简化的 HTML 文件,以便于存档,或通过电邮、博客共享。
也可以从
https://github.com/lihlii/msg_cleanup/tree/master/163.com
下载最新的脚本程序。在使用该脚本程序前,需要安装 ActiveState Perl。
转换后的网页例子:
委内瑞拉总统查韦斯逝世 网易读者评论
http://lihlii.blogspot.com/2013/03/blog-post_6.html
其中每条评论前的方括号里的两个数字,如 [0.4],0表示是该页的第1条评论,.4 表示其中引用的第4条/层回复评论。
世界人权宣言抄写 将留言和手抄纸张的图片用电邮发送到
udhr1948...@blogger.com
即可张贴到
http://udhrhw.blogspot.com
,发送到
udh...@posterous.com
即可张贴到
http://udhrhw.posterous.com
;或发送到
udhr1948...@gmail.com
由管理员转发至两个博客。建议在邮件标题中写明你想公布的网络身份(如推特、微博帐号,电邮地址等)、昵称或姓名、以便于避免重复搜集发布。
163.com.7z
Reply all
Reply to author
Forward
0 new messages