Skip to content

Commit 965109a

Browse files
author
hexing
committed
test
1 parent 845d6dd commit 965109a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

spider/pipelines.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def process_item(self, item, spider):
1414
return item
1515

1616
class SolPipeLine(object):
17-
project_dir = os.path.abspath(os.path.dirname(__file__))
18-
IMAGES_STORE = os.path.join(project_dir, 'images')
19-
17+
2018
def process_item(self, item, spider):
21-
folder = os.getcwd()[:-4] + 'code\\'
19+
folder = os.getcwd() + '/code/'
2220
if not os.path.exists(folder):
2321
os.makedirs(folder)
24-
self.file = codecs.open(folder + item['name'] + '.sol', "w", encoding="utf-8")
22+
print('目录地址:' + folder);
23+
24+
self.file = codecs.open(folder + '/' + item['name'] + '.sol', "w", encoding="utf-8")
2525
content = item['code']
2626
self.file.write(content)
2727
print("run here hosea")

spider/spiders/smart_contract_spider.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ def parseCode(self, response):
3535
item['code'] = response.xpath('//*[@id="editor"]/text()').extract_first()
3636

3737
print(item)
38-
38+
3939
yield item
40-
41-
return item
4240

4341

4442

0 commit comments

Comments
 (0)