Browse Source

add re-try

ming 3 years ago
parent
commit
a1a201c3a7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      similar_web/main.py

+ 2 - 1
similar_web/main.py

@@ -78,6 +78,7 @@ async def get_domain(req:q_req):
         
         
         js=''
         js=''
         for i in range(0,50):
         for i in range(0,50):
+            print('Try'+str(i)+'times')
             while True:
             while True:
                 try:
                 try:
                     response = requests.request("GET", url, headers=headers, params=querystring)
                     response = requests.request("GET", url, headers=headers, params=querystring)
@@ -85,7 +86,7 @@ async def get_domain(req:q_req):
                 except:
                 except:
                     continue
                     continue
                 break
                 break
-                
+
         jsdict={'SiteName':js['name'],'Description':js['siteDescription'],'GlobalRank':js['globalRank'],'Title':js['name'],'Category':js['categoryRank']['taxonomy'],'CountryRank':js['countryRank']['rank']}
         jsdict={'SiteName':js['name'],'Description':js['siteDescription'],'GlobalRank':js['globalRank'],'Title':js['name'],'Category':js['categoryRank']['taxonomy'],'CountryRank':js['countryRank']['rank']}