-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbook.py
More file actions
25 lines (22 loc) · 744 Bytes
/
fbook.py
File metadata and controls
25 lines (22 loc) · 744 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
import selenium_browser
from selenium_browser import browser
from selenium.webdriver.common.keys import Keys
from secret import FACEBOOK_USERNAME
from secret import FACEBOOK_PASSWORD
from secret import FACEBOOK_PAGE
from secret import FACEBOOK_SELECTOR
def fbook_get(url, selector):
browser.get(url)
e = browser.find_element_by_name('email')
e.send_keys(FACEBOOK_USERNAME)
p = browser.find_element_by_name('pass')
p.send_keys(FACEBOOK_PASSWORD)
p.send_keys(Keys.RETURN)
results = []
results = browser.find_elements_by_css_selector(selector)
return results
results = fbook_get(FACEBOOK_PAGE, FACEBOOK_SELECTOR)
import ipdb; ipdb.set_trace()
for result in results:
print(result.text)
print(8 * '-')