我希望这段代码能做什么:
当前代码的作用:
所以不要在excel电子表格中使用它:
苹果
苹果
苹果
苹果
我希望它在电子表格中提供此输出:
苹果
香蕉
橙色
猕猴桃
product_name = driver.find_elements_by_class_name('s-item__title') # finds names of each of the listings on each of the pages
for t in product_name:
for h in range(0, 100):#Cell position generator
a = h + 1
worksheet.write('B{}'.format(a), t.text)
workbook.close()
product_name = driver.find_elements_by_class_name('s-item__title')
for t, h in zip(product_name, range(0, len(product_name))):
a = h + 1
worksheet.write('B{}'.format(a), t.text)
workbook.close()