grabFacebookData.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:facebook-group-scrape 作者: mchirico 项目源码 文件源码
def getJSONfromURL(url):
    user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'
    values = {}
    headers = { 'Authorization':  BEAR}
    h = MyHTTPRedirectHandler()
    opener = urllib2.build_opener(h)
    urllib2.install_opener(opener)
    data = urllib.urlencode(values)
    json_data = ""
    try:
        req = urllib2.build_opener(h)
        req = urllib2.Request(url)
        response = urllib2.urlopen(req)
        the_page = response.read()
        json_data = json.loads(the_page)
    except:
        print("Error reading data members")
    return json_data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号