【发布时间】:2018-02-15 14:29:36
【问题描述】:
我正在尝试让这个 github 上的这个 python 脚本工作。
https://gist.github.com/lebedov/f09030b865c4cb142af1
脚本从 Google 检索股票报价。
当我运行函数 stock = get_google_finance_intraday("AAPL") 时,我收到错误 _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
我追踪到导致错误的代码行。
这是第 39 行。
reader = csv.reader(page.content.splitlines())
我正在使用 python v3.6。我怀疑代码在 python v2 上运行,但不是在 v3 上运行。
【问题讨论】:
标签: python python-3.x iterator