TypeError: list indices must be integers or slices, not str报错时的解决方法

这个是在使用BeautifulSoup的时候遇到的问题 原因 find()和find_all(), select()和select_all()获得的数据类型有差异。 当使用 find() select_one() 获得的数据类型是标签 其类型表现为 <class 'bs4.element.Tag'

Max retries exceeded with url错误

进行requests库学习的时候,报Max retries exceeded with url错误,经过网上查询可能fiddler开的连接数太多了,简单来说就是目标不可达,链接失效可用try尝试截取错误信息。 http连接太多没有关闭导致的。 解决办法: 1、增加重试连接次数 requests.ad