forked from Shahrayar123/Python-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFacebook_Bot.py
More file actions
25 lines (21 loc) · 691 Bytes
/
Copy pathFacebook_Bot.py
File metadata and controls
25 lines (21 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class Facebook:
def __init__(self,username,password):
self.username=username
self.password=password
self.bot=webdriver.Chrome()
def login(self):
bot=self.bot
bot.get("https://www.facebook.com/")
time.sleep(5)
email=bot.find_element_by_id("email")
email.clear()
email.send_keys(self.username)
password=bot.find_element_by_id("pass")
password.clear()
password.send_keys(self.password)
password.send_keys(Keys.RETURN)
load = Facebook('enter_email','enter_password')
load.login()