我正在通过API google custom search
使用google_api_client python
。我想检索特定查询的pdf文档。下面是执行此功能的函数。
def query_results(service,q=None,startIndex=1,siteSearch=None,fileType=None):
return service.cse().list(
q=q,cx='000906600611484344115:o9lfdh9y1m5',start=startIndex,siteSearch=siteSearch,fileType=fileType,safe='off'
).execute()
当我通过q="alienware",filetype="pdf" and siteSearch="google.com"
调用上述方法时,几乎看不到任何结果。但是,当我通过浏览器在Google搜索中输入相同的查询filetype:pdf alienware
时,I got plenty of results.
我做错了吗?或api本身是否有问题?
当我说I got plenty of results
时,是指下图