Python轻松登录模块
Easy-Login模块是Python的库,它可以帮助您通过Python登录您的社交帐户,如 Facebook、Instagram、Twitter、Linkedin、Reddit 等,而无需手动打开网站。
安装
这个模块没有内置在Python中。您需要在外部安装它。要安装此模块,请在终端中键入以下命令。
pip install easy-login
它将使用 chrome webdriver 在单独的窗口中自动登录您的帐户,并将带您进入该网站的主页
网络驱动程序
Selenium需要 Web 驱动程序来与所选浏览器交互。 Web 驱动程序是与 Web 浏览器交互的包。它通过对所有人都通用的有线协议与网络浏览器或远程网络服务器进行交互。您可以签出并安装您选择的浏览器的网络驱动程序。
Chrome: https://sites.google.com/a/chromium.org/chromedriver/downloads
Firefox: https://github.com/mozilla/geckodriver/releases
Safari: https://webkit.org/blog/6900/webdriver-support-in-safari-10/
用户名和密码必须与您必须登录的帐户相同,并且必须是字符串格式。地址必须是带有正斜杠(/)的字符串格式,例如 C:/Users/user1/chromedriver_win32/chromedriver 。
这是此模块的演示:
python3
# importing the module
from easy_login import login
# initializing the username and password
username = ""
password = ""
# initializing the address of chrome web driver
address = ""
# creating an object of login
obj = login(username, password, addresses)
# calling the account in which we want to login
obj.Facebook()
obj.Instagram()
obj.Twitter()
obj.Linkedin()
obj.Reddit()