|
@@ -6,6 +6,7 @@ import os
|
|
|
import dataset
|
|
|
import datetime
|
|
|
import json
|
|
|
+import ast
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
db = dataset.connect('sqlite:///similar.db')
|
|
|
|
|
@@ -46,7 +47,8 @@ async def read_item(domain_name):
|
|
|
jsdata=conn.root.get_url('https://data.similarweb.com/api/v1/data?domain='+domain_name)
|
|
|
print(jsdata)
|
|
|
# jsdict=str(jsdata)[1:-1]
|
|
|
- jsdict=json.loads(str(jsdata))
|
|
|
+# jsdict=json.loads(str(jsdata))
|
|
|
+ jsdict=ast.literal_eval(str(jsdata))
|
|
|
# jsdict=str(jsdata)
|
|
|
table=db['similar']
|
|
|
jstr=json.dumps(jsdict)
|