python报错对象没有属性_python-AttributeError:“ dict”对象没有属性“...

results=api.search(q="microsoft",count=100)

print type(results)

print json.load(results)

结果在这里已经是字典.

无需将其反序列化为JSON.

API.search(q[, lang][, locale][, rpp][, page][, since_id][,

geocode][, show_user])

Returns tweets that match a specified query.

Parameters:

q – the search query string

lang – Restricts tweets to the given language, given by an ISO 639-1 code.

locale – Specify the language of the query you are sending. This is intended for language-specific clients and the default should work in the majority of cases.

rpp – The number of tweets to return per page, up to a max of 100.

page – The page number (starting at 1) to return, up to a max of roughly 1500 results (based on rpp * page.

geocode – Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by “latitide,longitude,radius”, where radius units must be specified as either “mi” (miles) or “km” (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly.

show_user – When true, prepends “:” to the beginning of the tweet. This is useful for readers that do not display Atom’s author field. The default is false.

Return type:

list of SearchResult objects

注意:“返回类型:”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值