Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from selenium import webdriver
- from selenium.webdriver.common.keys import Keys
- from bs4 import BeautifulSoup
- import time
- # get the path of ChromeDriverServer
- dir = os.path.dirname(__file__)
- chrome_driver_path = dir + "chromedriver.exe"
- # create a new Chrome session
- driver = webdriver.Chrome(chrome_driver_path)
- driver.implicitly_wait(30)
- driver.maximize_window()
- # navigate to the application home page
- driver.get("http:/facebook.com")
- # get the search textbox
- search_fielduser = driver.find_element_by_name("email")
- search_fieldpass = driver.find_element_by_name("pass")
- # enter search keyword and submit
- search_fielduser.send_keys("username")
- search_fieldpass.send_keys("password")
- search_fielduser.submit()
- driver.implicitly_wait(30)
- #add profile id with visible friends
- driver.get("https://www.facebook.com/search/#profilenumber/friends")
- SCROLL_PAUSE_TIME = 0.5
- html = driver.page_source
- soup = BeautifulSoup(html, "html.parser")
- links = soup.find_all('_3u1 _gli _uvb')
- print(links)
- print ("klaar")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement