Skip to content

Commit 5afc6fe

Browse files
committed
修复一些小问题
1 parent 42a309d commit 5afc6fe

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

guoke/guoke_spider.py

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def save_article(content):
7474
f.write('\n'.join([str(content.get('title')), str(content.get('autor')), str(content.get('article'))]))
7575
print('Downloaded article path is %s' % file_name)
7676
else:
77+
file_name = str(content.get('title')) + '.txt'
7778
print('Already Downloaded', file_name)
7879
except requests.ConnectionError:
7980
print('Failed to Save Image,item %s' % content)

jd_login/login_by_selenium.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time
33
from selenium import webdriver
44

5-
# 强东的系统登陆模块没有用iframe,定位也没有微博那么复杂,可以靠id定位登陆
65
login_url = 'https://passport.jd.com/new/login.aspx'
76
driver = webdriver.PhantomJS()
87
driver.get(login_url)

liepin/liepin_login.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- requests
55
- bs4
66
'''
7+
import getpass
78
import hashlib
89
import requests
910
from bs4 import BeautifulSoup
@@ -71,6 +72,6 @@ def login(self):
7172

7273
if __name__ == '__main__':
7374
userName = input("请输入你的用户名:")
74-
password = input("请输入你的密码:")
75+
password = getpass.getpass("password:")
7576
lp = Leipin(userName, password)
7677
print(lp.login())

sina/sina.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import getpass
2+
13
import requests
24
import hashlib
35
import time

0 commit comments

Comments
 (0)