title: How can I save the result from searchtweets into json files using python?
body: <p>I am recently working on twitter analysis and want to save the results from twitter search locally into .json files.</p>
  
  <p>I am doing both historical search using "searchtweets" and streaming using "tweepy". The result I get are objects which are slightly different but I think both of the results are compatible with .json.</p>
  
  <p>Here are my code(sample, I have a logged in to API already):</p>
  
  <pre><code>new_tweets = API.user_timeline(screen_name='huliangw20', count=20, 
  tweet_mode='extended')
  
  with open('test_tweets_v2.json', 'w',encoding='utf-8') as outfile:
      outfile.write(new_tweets)
  </code></pre>
  
  <p>It does not work. <strong>In general, each query gives me a Resultset of many Tweet objects. And my goal is to save those objects into .json files using python.</strong> </p>
  
  <p>Would really appreciate if you could give me some advice on this.</p>