執行 with 出現 AttributeError: __enter__ 出現錯誤
2019/12/11 下午 03:31
Python網路爬蟲討論版
Kevin Yang
觀看數:2
回答數:2
收藏數:0
pycrawler
pycrawler-d09
回答列表
-
2019/12/11 下午 07:09Jeffrey贊同數:0不贊同數:1留言數:1
修正成這樣試一下
img_url = ('https://i.imgur.com/{}.jpg'.format(img_id))
-
2019/12/12 上午 11:31張維元 (WeiYuan)贊同數:0不贊同數:0留言數:0
嗨,請問你的 request 版本是什麼?有可能是版本不支援 with 所造成的問題,可以參考這篇:https://stackoverflow.com/questions/56719749/why-am-i-getting-the-error-atributeerror-enter-when-using-requests-get-i