如何使用python创建HTML文件的json

时间:2018-10-30 10:29:24

标签: python html json

我正在学习python,我真的想专门研究这种语言。

我有一个问题,如果有人可以给我一些步骤/线索来做,我会很高兴。

我必须从URL中获取信息,将其提取出来并赋予json格式。 我已经提取了信息,但是我不知道如何从该信息创建一个json。 Web和json格式如下:

www.abcr.de/shop/zh/catalogsearch/advanced/result/?limit=25&mode=list&name=%25&offset=0

[
{
"pid"​ : ​ ​ "0590S",
"name"​ : ​ ​ "Bergaptol",
"CAS"​ : ​ ​ "486-60-2",
"structure"​ : ​ ​ "C<sub>11</sub>H<sub>6</sub>O<sub>4</sub>",
"smiles"​ : ​ ​ "OC1=C2C=CC(=O)OC2=CC2=C1C=CO2",
"description"​ : ​ ​ "[...]",
"url"​ : ​ ​ "domain.com/product_page",
"img"​ : ​ ​ "domain.com/product_page/main_image.png",
"pdf_msds"​ : ​ ​ "domain.com/product_page/sds_document.pdf",
"synonyms"​ : ​ [
"4-Hydroxypsoralen"​ ,
"5-Hydroxypsoralen"
],
"packaging"​ : ​ {
"10mg"​ : ​ ​ 139.00,
"25mg"​ : ​ ​ 242.50
},
"properties"​ : ​ {
"molecular_weight"​ : ​ ​ "202.17",
"melting_point"​ : ​ ​ "276-288°C",
"boiling_point"​ : ​ ​ "675°C",
"flash_point"​ : ​ ​ "",
"purity"​ : ​ "
≥ 99%"
},
"safety"​ : ​ {
"p_statements"​ : ​ ​ [ ​ "P260"​ , ​ ​ "P262"​ ],
"h_statements"​ : ​ ​ [ ​ "H302"​ , ​ ​ "H315"​ , ​ ​ "H319"​ , ​ ​ "H335"​ ],
"symbol"​ : ​ "
SGH07",
"storage"​ : ​ ​ "Store at : <+8°C. Store in dry and dark place.",
"shipping"​ : ​ ​ "Ambient temperature"
},
"other"​ : ​ {
"family"​ : ​ "
Coumarin",
"subfamily"​ : ​ ​ "Furocoumarin",
"..."​ : ​ ​ "..."
}
}
,
{
}
]
"pid"​ : ​ "
0823M",
"..."​ : ​ "
..."

非常感谢!

0 个答案:

没有答案