I am trying to save a json object that I scraped from a webpage into a csv file for geoprocessing. This is the code:
from bs4 import BeautifulSoup
import json
import urllib2
import csv
import os
import requests
import re
page1 = urllib2.urlopen("http://runkeeper.com/user/212579518/route/513771")
soup = BeautifulSoup(page1)
point_re = re.compile('.*routePoints =(.*);')
point_json = point_re.search(str(soup)).group(1)
point_data = json.loads(point_json)
##thislineworks
with open('test2.csv','wb') as f:
w = csv.writer(f)
w.writerows(point_data())
When I execute the code I got this message:
Traceback (most recent call last):
File "C:\Users\Jesus\Desktop\scrapping1advance1.py", line 19, in <module>
w.writerows(point_data())
TypeError: 'list' object is not callable
Any ideas on what i am doing wrong?
Thanks