Мой код:
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]))
Мой файл JSON:
{"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}
Я запускаю свой код введите описание изображения здесь
Какимпорт в мою базу данных введите описание изображения здесь