Python代码:
productLinks = [div.a for div in
soup.findAll('div', attrs={'class' : 'a-row a-spacing-none'})]
print(productLinks)
for link in productLinks:
print(hr.append(link['href']))
错误:
Traceback (most recent call last):
File "C:\Python34\api.py", line 20, in <module>
print(hr.append(link['href']))
TypeError: 'NoneType' object is not subscriptable