snudm / naver-blog-crawler

crawler code
29 stars 12 forks source link

Fix IOError #2

Open e9t opened 9 years ago

e9t commented 9 years ago
$ python blog_crawler.py 
How many blog pages you need?: 1
Traceback (most recent call last):
  File "blog_crawler.py", line 70, in 
    total_page_crawler(page_need)
  File "blog_crawler.py", line 64, in total_page_crawler
    each_page_crawler(images, p)
  File "blog_crawler.py", line 56, in each_page_crawler
    write_file(jsonfile, i, p)
  File "blog_crawler.py", line 32, in write_file
    f = open('data/FoodBlog_{0:02d}.json'.format(i+(p-1)*10), 'w')
IOError: [Errno 2] No such file or directory: 'data/FoodBlog_01.json'
e9t commented 9 years ago

data 폴더를 자동을 생성해주든지, data 폴더를 input으로 받든지. 후자가 더 좋은 접근.