Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook New Design #42

Open
krawez opened this issue Sep 21, 2020 · 2 comments
Open

Facebook New Design #42

krawez opened this issue Sep 21, 2020 · 2 comments

Comments

@krawez
Copy link

krawez commented Sep 21, 2020

Facebook has updated its layout, so all the parsing has to be reviewed :(

@brutalsavage brutalsavage pinned this issue Sep 21, 2020
@othmanechentouf
Copy link

Did you manage to fix it ?
Thank you

@krawez
Copy link
Author

krawez commented Sep 22, 2020

Here are a couple html codes for parsing I found so far (I am using Selenium, but can easily be updated to BeatifulSoup):

  • Posts:
    driver.find_elements_by_xpath("//div[@data-testid='Keycommand_wrapper_feed_story']/div[@data-testid='Keycommand_wrapper']/div[@ROLE='article']"

  • Post_text:
    post.find_element(By.CSS_SELECTOR,"div[data-ad-comet-preview='message']")

  • Reactions (Top 3):
    reactions = post.find_element_by_css_selector("span[role='toolbar']").find_elements_by_css_selector("div[role='button']")
    for reaction in reactions:
    reaction = reaction.get_attribute("aria-label")

I am struggling to extract the date - if someone has the solution - would love to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants