我正在尝试通过 BeautifulSoup 处理一个 json 文件,但不知道如何实现这一点......
下面是 json 的副本,我正在尝试遍历 json 中的每个 id 并提取某些数据......有人建议不同的路线吗?
{
"line_type":"Test",
"title":"Test Test Test",
"timestamp":"201310200000",
"line": [
{
"id":10,
"text": "<h1 id=\"r021\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":9,
"text": "<h1 id=\"r023\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":8,
"text": "<h1 id=\"r024\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":7,
"text": "<h1 id=\"r026\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":6,
"text": "<h1 id=\"r027\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":5,
"text": "<h1 id=\"r028\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":4,
"text": "<h1 id=\"r029\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":3,
"text": "<h1 id=\"r031\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":2,
"text": "<h1 id=\"r032\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } , {
"id":1,
"text": "<h1 id=\"r035\">\n Titles here <\/h3>\n\n <a href=\"\/restofthewebsite\/here\" class=\"but-cl1\">Link<\/a>\n \n" } ]
}
提前致谢 - Hyflex