0

My code :

import re
import json
with open('tem.txt', encoding='utf-8-sig') as json_file:
    data = json.load(json_file)
    for p in data:
        data[p] = re.sub("<[^>]+>", "", str(data[p]))
        print("%s: %s" % (p, data[p]))

My json file :

{"Id":94477,"StrId":"\u003ca class=\u0027title-8 \u0027 title=\u002794477\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e94477\u003c/a\u003e","Quan":"\u003ca class=\u0027title-8 \u0027 title=\u0027Bình Tân\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eBình Tân\u003c/a\u003e","Duong":"\u003ca class=\u0027title-8 \u0027 title=\u0027Liên Khu 2-10\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eLiên Khu 2-10\u003c/a\u003e","Gia":"\u003ca class=\u0027title-8 cred\u0027 title=\u00272.8 Tỷ\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e2.8 Tỷ\u003c/a\u003e","DienTich2":"\u003ca class=\u0027title-8 \u0027 title=\u00274x12\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e4x12\u003c/a\u003e","LoGioi2":"","Huong":"\u003ca class=\u0027title-8 \u0027 title=\u0027Đông\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eĐông\u003c/a\u003e","Url":"\u003ca class=\u0027title-8 \u0027 title=\u0027Chi tiết\u0027 target=\u0027_blank\u0027 href=\u0027https://www.facebook.com/media/set/?set=oa.2342022366052447&type=3\u0027\u003eChi tiết\u003c/a\u003e","ChuNha":"\u003ca class=\u0027title-8 \u0027 title=\u0027Chị Tuyết\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eChị Tuyết\u003c/a\u003e","SoNha":"\u003ca class=\u0027title-8 \u0027 title=\u0027đã bán.17/19 (Hình+Sổ A.Hùng)\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eđã bán.17/19 (Hình+S\u003c/a\u003e","ViTri":null,"HienTrang":"","Email":"","LuotXem":6,"DienThoai":"\u003ca class=\u0027title-8 \u0027 title=\u00270934942927\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e0934942927\u003c/a\u003e","Phuong":"\u003ca class=\u0027title-8 \u0027 title=\u0027Bình Hưng Hoà A\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003eBình Hưng Hoà A\u003c/a\u003e","NgayTao":"\u003ca class=\u0027title-8 \u0027 title=\u002706/09/2019\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e06/09/2019\u003c/a\u003e","IsHot":true,"HienTrang2":"\u003ca class=\u0027title-8 \u0027 title=\u00271 Tấm\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e1 Tấm\u003c/a\u003e","LoGioi":"\u003ca class=\u0027title-8 \u0027 title=\u00276M\u0027 target=\u0027_blank\u0027 href=\u0027/Detail.aspx?Index=94477\u0027\u003e6M\u003c/a\u003e","CurrentMember":{"Id":10229,"Role":"Member","Username":"quang032018","Ten":"Quang Btra"},"OwnerId":10154,"ChoiceItemIds":[75877,60468,84656,83414,84419,83007,60545,83357,84699,83012,79450,60644,92436,92437],"Map":null,"Cancel":"","Choose":"\u003ca href=\u0027javascript:void(0);\u0027 class=\u0027pointer inblock w4\u0027 ref=\u002794477\u0027 onclick=chooseItem(this);return false;\u0027\u003eChọn\u003c/a\u003e","Sua":"","Xoa":"","Up":"","CanEdit":false,"IsChose":false}

I run my code. enter image description here

How to import in my database. enter image description here

1 Answer 1

1

You can use sqlite3 and access that database using SQL.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.