diff --git a/gunicorn.conf.py b/gunicorn.conf.py index bd1857b..9a1b3d5 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -2,9 +2,9 @@ workers = 4 # 监听内网端口5000【按需要更改】 # coc -# bind = '127.0.0.1:5003' +bind = '127.0.0.1:5003' # beta -bind = '127.0.0.1:5005' +# bind = '127.0.0.1:5005' # 设置守护进程【关闭连接时,程序仍在运行】 daemon = True # 设置超时时间120s,默认为30s。按自己的需求进行设置 diff --git a/lib/crawler.py b/lib/crawler.py index 9ba1d63..51bd93e 100644 --- a/lib/crawler.py +++ b/lib/crawler.py @@ -34,7 +34,7 @@ def connection(username,password,phone): r = s.get(url='http://portal-cust-edu-cn-s.webvpn.cust.edu.cn:8118/custp/index') soup=BeautifulSoup(r.text,'html.parser') try: - ip = soup.findAll(name='a')[6]['href'][7:].split("-") + ip = soup.findAll(name='a')[7]['href'][7:].split("-") except: return {'errcode': 101, 'errmsg':'账号或者密码错误'} r = s.get(url='http://mysso-cust-edu-cn-s.webvpn.cust.edu.cn:8118/cas/login?service=http://'+ip[0]+'.'+ip[1]+'.'+ip[2]+'.'+ip[3]+':8080/welcome',allow_redirects=False)