TypeError: 'NoneType' object is not iterable
源码
def get_url(lines):
urls=[]
for line in lines:
if 'img' in urls:
url=line.split('src=')[-1].split('"')[1]
urls.append(url)
def outputto(urls):
count=0
for line in urls:
print('第{:2}个url为{}'.format(count,line))
count=count+1
意思是urls里面的内容为空
向上找发现 上面的get_url 函数未添加return 返回值
需要在下面的函数调用,所以返回报错
运行后在for line in urls 报错