Created
April 19, 2013 05:07
-
-
Save holys/5418273 to your computer and use it in GitHub Desktop.
格式化json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"my_tags":[],"html":"\n\n<div class=\"indentpop1 clearfix\">\n <form action=\"\/j\/subject\/1300802\/interest\" method=\"POST\" class=\"j a_interest_form movie-sns\"><div style=\"display:none;\"><input type=\"hidden\" name=\"ck\" value=\"Uw7q\"/></div>\n \n\n <div class=\"interest-form-hd\">\n <span class=\"gact rr\">\n <a href=\"javascript:;\"onclick=\"close_dialog()\">x<\/a>\n <\/span>\n <h2>添加收藏:修改<\/h2>\n <\/div>\n <div class=\"interest-status\" style=\"float:left;font-size:14px;margin-bottom:15px\">\n <label>\n <input type=\"radio\" value=\"wish\" name=\"interest\" checked\/> 想看\n <\/label> \n <label>\n <input type=\"radio\" value=\"collect\" name=\"interest\" \/> 看过\n <\/label> \n <\/div>\n\n <div class=\"interest-rating\">\n <span class=\"j a_stars\"><span class=\"rate_stars\">给个评价吧?(可选):\n <span id=\"rating\"><span id=\"stars\">\n <img src=\"\/pics\/nst.gif\" id=\"star1\"\/><\/a><img src=\"\/pics\/nst.gif\" id=\"star2\"\/><\/a><img src=\"\/pics\/nst.gif\" id=\"star3\"\/><\/a><img src=\"\/pics\/nst.gif\" id=\"star4\"\/><\/a><img src=\"\/pics\/nst.gif\" id=\"star5\"\/><\/a><\/span><span id=\"rateword\" class=\"pl\"\/><\/span>\n <input id=\"n_rating\" type=\"hidden\" value=\"\" name=\"rating\" \/><\/span><\/span><\/span>\n <\/div>\n\n <div class=\"tags-switch\">\n <a id=\"showtags\" rel=\"高级(标签和短评) ▼\" href=\"javascript:void(0)\">缩起 ▲<\/a>\n <\/div>\n\n <input id=\"foldcollect\" name=\"foldcollect\" value=\"U\" type=\"hidden\"\/>\n <ul id=\"advtags\" class=\"interest_form\">\n <li>标签(多个标签用空格分隔): <\/li>\n <li>\n <input name=\"tags\" type=\"text\" class=\"inp-tags\">\n <\/li>\n <li id=\"mytags\" class=\"clearfix\"><\/li>\n <li id=\"populartags\" class=\"clearfix\"><\/li>\n <li class=\"comment-label\">\n <span id=\"left_n\" class=\"num\">350<\/span>\n 简短评论:\n <\/li>\n <li>\n <textarea name=\"comment\" class=\"comment\" id=\"comment\" maxlength=\"350\"><\/textarea>\n <\/li>\n <li class=\"private\">\n <input id=\"inp-private\" name=\"private\" type=\"checkbox\" \/>\n <label class=\"pl\" for=\"inp-private\">仅自己可见<\/label>\n <\/li>\n <li>\n <div id=\"error\" class=\"errnotnull\">\n <\/div>\n <\/li>\n <\/ul>\n\n <div class=\"interest-form-ft\" id=\"submits\">\n <style>\n.bottom-setting{width:440px;*width:400px;float:left}\n#sync-setting{color:#369;}\n#sync-setting:visited{color:#369;}\n#sync-setting:hover {background:none;color:#369;}\n#sync-setting img{vertical-align:baseline;*vertical-align:middle;opacity:.5;filter:alpha(opacity=50);display:inline-block;width:10px;height:10px;*display:inline;zoom:1;position:relative;top:1px;margin-left:5px;}\n#sync-setting:hover img{opacity:.8;background:none;filter:alpha(opacity=80)}\n#sync-setting img{width:10px;height:10px;}\n.book-sns .private{float:none;}\n.share-label{margin:8px;vertical-align:middle;*vertical-align:middle}\n#sync-setting{margin:2px}\n<\/style>\n\n<div class=\"bottom-setting\">\n <div class=\"ll\">\n <label class=\"pl\">分享到<\/label>\n <label class=\"pl share-label share-shuo\"> \n <input name=\"share-shuo\" type=\"checkbox\" checked=\"checked\" \/>豆瓣广播\n <\/label> \n <label class=\"pl share-label share-sina\">\n <input name=\"share-sina\" type=\"checkbox\" \/>新浪微博\n <\/label>\n\n <\/div>\n\n <a id=\"sync-setting\" href=\"\/settings\/\" target=\"_blank\" class=\"pl share-label rr\">分享设置<img src=\"\/pics\/movie-sns-sync-setting.png\" alt=\"分享设置\" \/><\/a>\n<\/div>\n\n <span class=\"bn-flat\"><input type=\"submit\" value=\"保存\" name=\"save\"><\/span>\n <\/div>\n <\/form>\n<\/div>\n","interest_status":"wish","popular_tags":["法国","阿佳妮","法国电影","历史","传记","爱情","IsabelleAdjani","电影","Adjani","意大利"],"tags":[]} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
首先将http://movie.douban.com/j/subject/1300802/interest 页面的内容保存为一个
.json文件, 这里取名interest.json,几行Python代码的事, 直接在Python shell里面敲.
这里没有处理tags里面的unicode, 所以unicode没有显示原文.
处理后效果: