Last active
September 12, 2020 13:43
-
-
Save chiaoyaaaaa/3d6a819cf3edbdd7f0e305c42b822b37 to your computer and use it in GitHub Desktop.
catch fb all post's number of likes
This file contains 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
# 建立一個空的list | |
like = [] | |
# 抓取每一篇貼文的按讚數 | |
# class name可能會修改,需要定期偵錯! | |
for ii in frames: | |
thumb = ii.find('span',class_="gpro0wi8 pcp91wgn") | |
# 有些貼文沒有按讚數,所以抓下來的東西是None,因此直接append 0 | |
if(thumb == None): | |
like.append('0') | |
else: | |
like.append(thumb.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment