def process_index(index, type, resource): response = urlopen(("%s%s/%s") % (WE_BASE_URL, WE_ITEM_PATH, index)) ip = ItemParser() ip.feed(response.read()) print ip.prepare_data(type, job=resource[index]) db_commit(ip.prepare_data(type, job=resource[index]))