试图只获得亚马逊搜索的第一页结果
Trying to get only first page results of amazon search
我目前正在尝试将此查询仅 return 结果的第一页。我目前正在使用 python amazon api,这是我的代码。
#!python
api = API(cfg=config.amzconfig)
query='justin bieber'
thingy = api.item_search('Blended', ResponseGroup='Large', Keywords=query)
print(thingy)
for thing in thingy:
# print(lxml.etree.tostring(item, pretty_print=True))
try:
print('%s' % thing.ItemAttributes.Title)
print('%s' % thing.DetailPageURL)
print('%s' % thing.SmallImage.URL)
except:
continue
这工作正常,但 return 的结果量确实很大。另一方面,如果我按照他们的文档中的说明进行操作并添加 paginate=False
它 return 没有结果。
挖完源后,可以放一个limit=1
得到页数
我目前正在尝试将此查询仅 return 结果的第一页。我目前正在使用 python amazon api,这是我的代码。
#!python
api = API(cfg=config.amzconfig)
query='justin bieber'
thingy = api.item_search('Blended', ResponseGroup='Large', Keywords=query)
print(thingy)
for thing in thingy:
# print(lxml.etree.tostring(item, pretty_print=True))
try:
print('%s' % thing.ItemAttributes.Title)
print('%s' % thing.DetailPageURL)
print('%s' % thing.SmallImage.URL)
except:
continue
这工作正常,但 return 的结果量确实很大。另一方面,如果我按照他们的文档中的说明进行操作并添加 paginate=False
它 return 没有结果。
挖完源后,可以放一个limit=1
得到页数