ming 3 år sedan
förälder
incheckning
d37bf9979a
1 ändrade filer med 2 tillägg och 4 borttagningar
  1. 2 4
      similar_web/main.py

+ 2 - 4
similar_web/main.py

@@ -133,10 +133,8 @@ async def get_domain_by_keyword(req:kw_req):
         url = "https://similarweb2.p.rapidapi.com/trafficoverview"
         querystring = {"website":domain_name}
 
-        response = requests.request("GET", url, headers=headers, params=querystring)
-        js2=json.loads(response.text)
-        jsdict['totalVisits'] = js2['engagement']['totalVisits']
-        jsdict['EstimatedMonthlyVisits']=js2['monthlyVisitsEstimate']
+        jsdict['totalVisits'] = js['engagement']['totalVisits']
+        jsdict['EstimatedMonthlyVisits']=js['monthlyVisitsEstimate']
         log_table = db['storage_similar_web']
         log_table.insert({'SiteName':raw_domain,'Description':jsdict['Description'],'GlobalRank':jsdict['GlobalRank']
         ,'Title':jsdict['Title'],'Category':jsdict['Category'],'CountryRank':jsdict['CountryRank'],'EstimatedMonthlyVisits':jsdict['EstimatedMonthlyVisits']