所以,我正在尝试编译一个包含某个单词的 Yahoo Answers 中所有问题的数据库。我目前正在使用我编写的以下脚本执行此操作,使用 Pynswers 包装类调用 Yahoo API
from Answers import Answers
app = Answers()
wbk = xlwt.Workbook()
sheet = wbk.add_sheet('sheet 1')
app.appid = '...'
questions = app.questionSearch({'query':'tornado',})
#Write all column headings
sheet.write(0,0, 'Question')
sheet.write(0,1,'Answer')
sheet.write(0,2, 'Date')
sheet.write(0,3,'Number of Answers')
for i, value in enumerate(questions):
content = value['Content'].strip()
chosenAnswer = value['ChosenAnswer'].strip()
date = value['Date'].strip()
numAnswers = value['NumAnswers'].strip()
#Write values into respect columns, (row, column)
sheet.write(i+1,0,content)
sheet.write(i+1,1,chosenAnswer)
sheet.write(i+1,2,date)
sheet.write(i+1,3,numAnswers)
wbk.save('C://test.xls')
问题是我从这个查询中只得到了大约 10 个回复,而且我想不出一种方法来扩大我得到的问题的范围。有任何想法吗?