SNSからデータを取得して、分析する練習をする時、AKBグループメンバーのGoogle+投稿を使用すると非常に楽しいです。それなりの分量もありますし。
メンバーのGoogle+ IDを、下記のサイトから一気に出力します。
http://www.google.com/intl/ja/+/project48/
BeautifulSoupというモジュールを使用します。下記がそのサイトです。
http://www.crummy.com/software/BeautifulSoup/
pip installでインストールできます。
Pythonで下記のようなスクリプトを書きました。
この例では結果をprintしていますが、リストとして別の処理に渡して、順次Activityを取得する、というような使い方ができると思います。
gidprint.py
#!bin/python
#coding: utf-8
from BeautifulSoup import BeautifulSoup
import urllib
def gidlist_make():
soup = BeautifulSoup(urllib.urlopen("http://www.google.com/intl/ja/+/project48/").read())
lisoup=[]
gidlist = []
for lisoup in soup.findAll("li"):
try:
gidlist.append(lisoup['data-gplusid'])
except:
continue
return gidlist
if __name__=='__main__':
gidlist= gidlist_make()
for gid in gidlist: