I'm trying to scrape facebook pages for analytical purposes using selenium.
http://www.facebook.com/123439757700947
Viewing page source I found the tag I need:
<title>Tzipi Hotovely - ציפי חוטובלי</title>
I used the method:
politician_name = driver.find_element_by_tag_name('title')
politician_name.text
which returned:
''
I would also like to get the number of people who liked the page from the following dictionary item:
"page_likers":{"global_likers_count":92987}
which is under the <script> tag:
I would love for some help...
I was trying the solution proposed:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
link = 'http://www.facebook.com/123439757700947'
driver.get(link)
title_name = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "pageTitle")))
print(title_name.text)
likes = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@id='PagesProfileHomeSecondaryColumnPagelet']//descendant::div[contains(@class,'clearfix')]/div[2]/div")))
print(likes.text)

