@@ -0,0 +1,708 @@
+# -*- coding: utf-8 -*-%0Aimport json%0Aimport urllib2%0Aimport pymongo%0A%0Astart_vacancy_id = 9520126  # 9777248%0Aprefix_url = 'https://api.hh.ru/vacancies/'%0Aclient = pymongo.MongoClient('localhost', 27017)%0Adb = client%5B'hh'%5D%0Acollection = db%5B'vacancies'%5D%0A%0A%0Adef get_vacancy(v_id):%0A    response = urllib2.urlopen(prefix_url + str(v_id))%0A    the_page = response.read()%0A    vacancy = json.loads(the_page)%0A    return vacancy%0A%0A%0Acollection.remove()%0Afor vacancy_id in range(start_vacancy_id, 0, -1):%0A    try:%0A        print vacancy_id%0A        collection.insert(get_vacancy(vacancy_id))%0A    except urllib2.HTTPError:%0A        print 'HTTPError ' + str(vacancy_id)%0A        collection.insert(%7B%22id%22: str(vacancy_id), %22error%22: True%7D)%0A

add vacancies_grabber.py