06步pythoncsv写入操作

tech2022-12-11  85

from lxml import etree with open('JD_Phone.csv', 'a', newline='', encoding='utf-8')as f: #这里不写目录,默认是开发文件project根目录下 write = csv.writer(f) p_price = 'div/div[@class="p-price"]/strong/i/text()' write.writerow(p_price) f.close()
最新回复(0)