Zip 函数可以进行多个list的迭代
for price, info, total_deal, seller, location in zip(prices, infos, total_deals, sellers, locations): products = { 'price': price, 'info': info.strip(), 'total_deal': total_deal, 'seller': seller.strip(), 'location': location, } print(products)
将几个list的元素合并为一个list的方法 使用extendA = [1,2,3]B = [3,4,5]A.extend(B)或者直接相加A + B = 一个新的list
因为学习爬虫需要redis和MongoDB
启动redis 先进入redis路径 再启用redis-server然后就开启了redis启动MongoDB 先进入MongoDB的路径 然后再sudo mongod 即可