Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
1061700625 authored Jul 13, 2023
1 parent 7b4e09c commit 9931015
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions 服务器版/search_grammarly_cookie_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def collect_cookies_linkstricks():
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
content = soup.find('code', class_='language-json').string
cookies.append(content)
except:
print('>> 访问超时, 2s后切换下一个链接')
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
return cookies
Expand All @@ -67,8 +67,8 @@ def collect_cookies_trytechnical():
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
content = soup.find('pre', class_='wp-block-preformatted').string
cookies.append(content)
except:
print('>> 访问超时, 2s后切换下一个链接')
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
return cookies
Expand All @@ -82,8 +82,8 @@ def collect_cookies_infokik():
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
content = soup.find('pre', class_='wp-block-code').string
cookies.append(content)
except:
print('>> 访问超时, 2s后切换下一个链接')
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
return cookies
Expand Down Expand Up @@ -126,7 +126,7 @@ def user_define_collect_cookies():

def search_valid_cookie():
cookies = user_define_collect_cookies()
print('>> 搜索完毕, 开始检查')
print(f'>> 搜索完毕, 开始检查, 共{len(cookies)}')
if os.path.exists('./cookies'):
print('>> 先清空一下cookies目录')
shutil.rmtree('./cookies')
Expand Down

0 comments on commit 9931015

Please sign in to comment.