Created
March 17, 2016 13:32
-
-
Save rla/e0cb48c127d3102e6202 to your computer and use it in GitHub Desktop.
Facebook group posts extraction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
posts(GroupUrl, Posts):- | |
Query = _{ | |
wait: 5300, | |
url: GroupUrl, | |
extract: _{ | |
posts: _{ | |
type: collection, | |
selector: '.userContentWrapper', | |
extract: _{ | |
title: _{ selector: 'h5' }, | |
url: _{ | |
selector: 'h5 + div > div > span > span > a', | |
property: 'href' | |
}, | |
texts: _{ | |
type: collection, | |
selector: '.userContent', | |
extract: _{ | |
text: _{ selector: ':root' } | |
} | |
} | |
} | |
} | |
} | |
}, | |
query(Query, Response), | |
maplist(drop_empty_texts, Response.posts, Posts). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment