import time, re
from fb_common import driver
d = driver()
URL = "https://www.facebook.com/collectif.de.citoyens.ucclois"
d.get(URL); time.sleep(6)
html = d.page_source
print("URL finale:", d.current_url)
print("len html:", len(html))
print("login_wall:", ("Connexion ou inscription" in html) or ('name="email"' in html))
print("titre:", (re.search(r'<title>([^<]+)</title>', html) or [None,'?'])[1][:120])
# liens de posts visibles
posts = set(re.findall(r'/(?:permalink|posts)/[0-9A-Za-z]+', html))
storyf = set(re.findall(r'story_fbid=\d+', html))
print("liens posts (regex html):", len(posts), list(posts)[:5])
print("story_fbid:", len(storyf), list(storyf)[:5])
print("contient 'commentaire':", html.lower().count("commentaire"))
d.quit()
