Closed Wilson1823 closed 2 years ago
每请求一组关键词,sleep一段时间?,比如(以下代码未实际运行)
import time
from qdata.baidu_index import get_search_index
from qdata.baidu_index.common import split_keywords
keywords_list = [['张艺兴', '汪峰'], ['百度'], ['疫情', '杭州'], ['北京', '疫情'], ['猫粮'], ['流浪猫']]
cookies = """xxx"""
for keywords in split_keywords(keywords_list):
for index in get_feed_index(
keywords_list=keywords,
start_date='2018-01-01',
end_date='2019-05-01',
cookies=cookies
):
print(index)
time.sleep(15)
更正
import time
from qdata.baidu_index import get_search_index
from qdata.baidu_index.common import split_keywords
keywords_list = [['张艺兴', '汪峰'], ['百度'], ['疫情', '杭州'], ['北京', '疫情'], ['猫粮'], ['流浪猫']]
cookies = """xxx"""
for keywords in split_keywords(keywords_list):
for index in get_search_index(
keywords_list=keywords,
start_date='2018-01-01',
end_date='2019-05-01',
cookies=cookies
):
print(index)
time.sleep(15)
如题