def start_requests(self):
with open("E:\\xxx.txt", "r", encoding='utf-8') as f:
list_a = list(f)
for name in list_a:
yield Request(url=self.start_url_template.format(weapon_name=name), cb_kwargs={"weapon_name": name},callback=self.parse)
Python中把txt文档中的内容转成列表,并传递给方法
最新推荐文章于 2024-01-13 02:39:21 发布