............................................................................................................................................................
def parse_data():
#解析商品数据
#多个商品数据解析
workbook=xlsxwriter.Workbook('demo.xlsx')
worksheet=workbook.add_worksheet()
divs=driver.find_elements_by_xpath('//div[@class="grid g-clearfix"]/div/div')#加个s变成列表!!!
for div in divs:
info=div.find_element_by_xpath('.//div[@class="row row-2 title"]/a').text#//是跨阶定位,商品名称
price=div.find_element_by_xpath('.//strong').text+'元'#价格
deal=div.find_element_by_xpath('.//div[@class="deal-cnt"]').text#付款人数
name=div.find_element_by_xpath('.//div[@class="shop"]/a/span[2]').text#店名
location=div.find_element_by_xpath('.//div[@class="location"]').text#地址
# deal_url=div.find_element_by_xpath('.//div[@class="pic"]/a').get_attribute('href')
worksheet.write('A',info)
worksheet.write('B',price)
worksheet.write('C',deal)
worksheet.write('D',name)
worksheet.write('F',location)
workbook.close()