Skip to content

Commit d2528ca

Browse files
authored
Merge pull request #123 from xclala/master
fix input password
2 parents 68e15e4 + 9fe5e4f commit d2528ca

7 files changed

Lines changed: 16 additions & 10 deletions

File tree

126email/126email.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import time
22
from selenium import webdriver
3-
3+
from getpass import getpass
44

55
def login():
6-
acount_num = input('请输入账号:\n')
7-
passwd_str = input('请输入密码:\n')
6+
acount_num = input('请输入账号:')
7+
passwd_str = getpass('请输入密码:')
88
driver = webdriver.Chrome()
99
url = 'http://mail.126.com/'
1010
driver.get(url)

163email/163email.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import time
2+
from getpass import getpass
23
from selenium import webdriver
34
from selenium.webdriver.common.by import By
45
from selenium.webdriver.support import expected_conditions as EC
56
from selenium.webdriver.support.ui import WebDriverWait
67

78

89
def login():
9-
acount_num = input('请输入账号:\n')
10-
passwd_str = input('请输入密码:\n')
10+
acount_num = input('请输入账号:')
11+
passwd_str = getpass('请输入密码:')
1112
driver = webdriver.Chrome()
1213
url = 'http://mail.163.com/'
1314
driver.get(url)

Github/login.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import re
66
import requests
7+
from getpass import getpass
78

89

910
class GithubLogin(object):
@@ -61,7 +62,7 @@ def get_token(self):
6162

6263
if __name__ == '__main__':
6364
email = input('Account:')
64-
password = input('Password:')
65+
password = getpass('Password:')
6566

6667
login = GithubLogin(email, password)
6768
login.login_GitHub()

baidu/baidu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import time
66
from uuid import uuid4
7+
from getpass import getpass
78

89
import requests
910

@@ -153,6 +154,6 @@ class LoginError(Exception):
153154

154155
if __name__ == '__main__':
155156
username = input("Username: ")
156-
password = input("Password: ")
157+
password = getpass("Password: ")
157158
b = BaiduLogin()
158159
b.login(username=username, password=password)

bilibili/bilibili.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from PIL import Image
88
from io import BytesIO
99
from time import sleep
10+
from getpass import getpass
1011
import random
1112

1213
"""
@@ -218,7 +219,7 @@ def crack(self):
218219

219220
if __name__ == '__main__':
220221
ACCOUNT = input('请输入您的账号:')
221-
PASSWORD = input('请输入您的密码:')
222+
PASSWORD = getpass('请输入您的密码:')
222223

223224
test = BiliBili(ACCOUNT, PASSWORD) # 输入账号和密码
224225
test.crack()

csdn/selenium_csdn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# @Date: 2020-08-14 17:40:11
55
import os
66
import random
7+
from getpass import getpass
78
import asyncio
89
from pyppeteer import launch
910

@@ -67,7 +68,7 @@ async def crawl(self):
6768
def main():
6869
print('[*] 模拟登陆 CSDN 程序启动...')
6970
account = input('[*] 请输入账号:')
70-
password = input('[*] 请输入密码:')
71+
password = getpass('[*] 请输入密码:')
7172
login = Api(account, password)
7273
loop = asyncio.get_event_loop()
7374
loop.run_until_complete(login.crawl())

taobao/taobao_via_username_password.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from selenium.webdriver.common.by import By
55
from selenium.webdriver.support import expected_conditions
66
from selenium.webdriver.support.ui import WebDriverWait
7+
from getpass import getpass
78

89
"""
910
运行前必须要做的事情:
@@ -77,6 +78,6 @@ def login(self):
7778

7879
if __name__ == "__main__":
7980
username = input("请输入用户名:")
80-
password = input("请输入密码:")
81+
password = getpass("请输入密码:")
8182
spider = TaobaoSpider(username, password)
8283
spider.login()

0 commit comments

Comments
 (0)