百度云api调用时出现“Max retries exceeded with url”的解决

    技术2022-07-10  122

    加sleep,例子:

    for i in range(0,len(df)): print(i) time.sleep(1) #这里 inputText=df.at[i,"微博正文"] print(inputText) if(len(inputText)<2048): accessToken = getToken() everyday_list.append(last_getProEmotion(inputText,accessToken)) else: data = cut_text(inputText, 1500) # 如果文章字节长度大于1500,则切分 accessToken = getToken() everyday_list.append(last_getProEmotion(data , accessToken)) print(everyday_list)
    Processed: 0.009, SQL: 9