使用pycharm编写程序(python 3.6),部分程序如下:
DAYS = 14 #nO need to modify this
GRAPH_URL_PREFIX = "https://graph.facebook.com/"
GROUP_SUFFIX = "/groups"
DEFAULT_LIMIT = "100" #Set to true if you like seeing console output
VERBOSE = True #Calculating a timestamp from DAYS
SINCE = datetime.datetime.now() - datetime.timedelta(DAYS)
def getFeed(access_token,group,name):
#Token-based auth header
headers = {"Authorization":"Bearer " + access_token}
params = "?fields=permalink_url,from,story,type,message,link,created_time,updated_time,likes.limit(0).summary(total_count),comments.limit(0).summary(total_count)"
#Default paging limit
params += "&&limit=" + DEFAULT_LIMIT
#Time-based limit
params += "&since=".encode("utf-8") + str(SINCE.strftime("%S"))
graph_url = GRAPH_URL_PREFIX + group + "/feed" + params
...
it错误:
File "C:\Python\PyCharmProject\FaceBookCrawl\group_download.py", line 32, in getFeed
params = params.encode("utf-8") + str(SINCE.strftime("%S"))
TypeError: can't concat bytes to str
但是我已经将params和SINCE.strftime("%S")
设置为str
,为什么
目前没有回答
相关问题 更多 >
编程相关推荐