Skip to content

Commit

Permalink
Update loveword.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Crtd-Code authored Feb 5, 2021
1 parent 5528ad4 commit 3cb3127
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions loveword.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/python3
#coding=utf-8

import requests
from bs4 import BeautifulSoup
import random
import os
import time
SKEY=os.environ.get('SKEY') #CoolPush酷推KEY
def getlovewords():
headers={
Expand All @@ -10,6 +14,7 @@ def getlovewords():
# 获取情话
texts=[]
for page in range(1,20):
time.sleep(3)
url = 'https://www.duanwenxue.com/huayu/tianyanmiyu/list_{}.html'.format(page)
response = requests.get(url,headers=headers)
soup=BeautifulSoup(response.text,'lxml')
Expand Down

0 comments on commit 3cb3127

Please sign in to comment.