educounts

In [1]:
import bs4
import requests
import dominate
from dominate.tags import *
import os
import shutil
import json
from urlparse import urlparse
from bs4 import BeautifulSoup
In [2]:
eceall = requests.get('https://www.educationcounts.govt.nz')
In [3]:
#eceall.text
In [4]:
edcountz = bs4.BeautifulSoup(eceall.text)
In [5]:
edu = edcountz.findAll('a')
In [6]:
taglisz = list()
In [7]:
tagliz = list()
In [8]:
gidict = dict()
In [9]:
for ed in edu:
    #print ed.text.replace(' ', '-')
    #print ed.attrs['href']
    #print ed.text[:22]
    gied = ed.text
    gifz = gied.replace(' ', '-')
    giflow = gifz.lower()
    gidict.update({giflow[:12] : ed.attrs['href']})
    o = urlparse(ed.attrs['href'])
    #change this path so that each element of the 
    #path can be used as TAGS
    #
    #print o.path
    #tapen = (o.path.replace('/', ', ')[1:])
    tapen = (o.path[1:])
    #gidict.update({ed.attrs['href'] : o.path[1:]})
    #print [tagz.strip() for tagz in tagz.split(',')]
    tagliz.append([tapen.strip() for tapen in tapen.split(',')])
    
    
    
In [9]:
 
In [10]:
json.dumps(gidict)
Out[10]:
'{"": "http://www.newzealand.govt.nz", "all": "/data-services/data-collections/all", "legal-&-priv": "/site-info/privacy", "skip-to-prim": "#primary-nav", "m\\u0101ori-educat": "https://www.educationcounts.govt.nz/statistics/maori-education", "school-roll-": "https://www.educationcounts.govt.nz/data-services/data-collections/national/school-roll-return", "m\\u0101ori-in-nce": "https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling/participation-and-attainment-of-maori-students-in-national-certificate-of-educational-achievement", "all-(adult-l": "https://www.educationcounts.govt.nz/data-services/data-collections/international/all", "university-r": "https://www.educationcounts.govt.nz/statistics/tertiary_education/university-rankings", "teaching-sta": "https://www.educationcounts.govt.nz/statistics/schooling/teaching_staff", "boards-of-tr": "https://www.educationcounts.govt.nz/data-services/data-collections/national/boards_of_trustees", "statistics-h": "https://www.educationcounts.govt.nz/statistics", "annual-early": "https://www.educationcounts.govt.nz/data-services/data-collections/national/ece_staff_return", "e-learning-r": "https://www.educationcounts.govt.nz/topics/ict_themes", "\\ntopics\\ntopi": "https://www.educationcounts.govt.nz/topics", "student-numb": "https://www.educationcounts.govt.nz/statistics/schooling/student-numbers", "benefits-of-": "https://www.educationcounts.govt.nz/statistics/international-education/benefits-of-international-education-for-nz2", "student-loan": "https://www.educationcounts.govt.nz/topics/26298", "annual-ece-c": "https://www.educationcounts.govt.nz/statistics/early-childhood-education/annual-ece-summary-reports", "bess-&-bes-c": "https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases", "reading-reco": "https://www.educationcounts.govt.nz/data-services/data-collections/national/reading-recovery-electronic-returns", "transition:-": "https://www.educationcounts.govt.nz/statistics/tertiary_education/transition-from-school-to-tertiary", "b": "https://www.educationcounts.govt.nz/data-services/glossary#B", "collecting-i": "https://www.educationcounts.govt.nz/data-services/collecting-information", "staffing": "https://www.educationcounts.govt.nz/statistics/early-childhood-education/staffing", "internationa": "https://www.educationcounts.govt.nz/data-services/data-collections/international/iccs_data", "deaker/berry": "https://www.educationcounts.govt.nz/topics/bes/Whats-New/deakerberryman-interview", "summary-tabl": "https://www.educationcounts.govt.nz/statistics/tertiary_education/summary_tables", "m\\u0101ori-tertia": "https://www.educationcounts.govt.nz/statistics/maori-education/tertiary-education", "bes-programm": "https://www.educationcounts.govt.nz/topics/bes", "participatio": "https://www.educationcounts.govt.nz/statistics/tertiary_education/participation", "ongoing-reso": "https://www.educationcounts.govt.nz/statistics/special-education/ongoing-resourcing-scheme", "piaac": "/data-services/data-collections/piaac", "school-leave": "https://www.educationcounts.govt.nz/data-services/data-collections/national/school_leavers", "literacy": "https://www.educationcounts.govt.nz/publications/literacy", "pisa-(progra": "https://www.educationcounts.govt.nz/data-services/data-collections/international/pisa", "teacher-cens": "https://www.educationcounts.govt.nz/data-services/data-collections/national/teacher_census", "d": "https://www.educationcounts.govt.nz/data-services/glossary#D", "h": "https://www.educationcounts.govt.nz/data-services/glossary#H", "directories": "https://www.educationcounts.govt.nz/data-services/directories", "know-your-re": "https://www.educationcounts.govt.nz/know-your-region", "tertiary-pro": "https://www.educationcounts.govt.nz/data-services/directories/list-of-tertiary-providers", "l": "https://www.educationcounts.govt.nz/data-services/glossary#L", "p": "https://www.educationcounts.govt.nz/data-services/glossary#P", "te-kete-ipur": "https://www.educationcounts.govt.nz/data-services/directories/maori-medium-schools/te-kete-ipurangi", "t": "https://www.educationcounts.govt.nz/data-services/glossary#T", "x": "https://www.educationcounts.govt.nz/data-services/glossary#X", "tertiary-enr": "https://www.educationcounts.govt.nz/data-services/data-collections/national/tertiary_enrolment_data", "\\nstatistics\\n": "https://www.educationcounts.govt.nz/statistics", "pasifika-ter": "https://www.educationcounts.govt.nz/statistics/pasifika-education/tertiary-education", "about-this-s": "/site-info/about-this-site", "investing-in": "http://www.minedu.govt.nz/theMinistry/EducationInitiatives/InvestingInEducationalSuccess.aspx", "series": "https://www.educationcounts.govt.nz/publications/series", "english-medi": "https://www.educationcounts.govt.nz/publications/maori/english-medium-education", "guidelines": "https://www.educationcounts.govt.nz/data-services/collecting-information/guidelines", "\\nfind-an-ear": "https://www.educationcounts.govt.nz/find-an-els", "\\ndata-servic": "https://www.educationcounts.govt.nz/data-services", "find-a-schoo": "https://www.educationcounts.govt.nz/find-school", "ng\\u0101-whanaket": "https://www.educationcounts.govt.nz/statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results", "home": "/", "sms-vendors": "https://www.educationcounts.govt.nz/data-services/collecting-information/sms_roll_returns", "the-research": "https://www.educationcounts.govt.nz/topics/research/research_division", "pisa": "/data-services/data-collections/pisa", "research": "https://www.educationcounts.govt.nz/statistics/tertiary_education/research", "iccs": "/data-services/data-collections/iccs_data", "talis-(teach": "https://www.educationcounts.govt.nz/data-services/data-collections/international/talis", "senior-stude": "https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment", "publications": "https://www.educationcounts.govt.nz/publications", "ministry-of-": "https://www.educationcounts.govt.nz/data-services/directories/early-childhood-services/ministry-of-education-20-hours-ece", "statistics-n": "https://www.educationcounts.govt.nz/topics/26298/statistics-nz-student-loans", "contact-us": "/site-info/contact-us", "rt:-lit": "https://www.educationcounts.govt.nz/data-services/data-collections/rtlit", "data-service": "https://www.educationcounts.govt.nz/data-services", "numeracy": "https://www.educationcounts.govt.nz/publications/numeracy", "g": "https://www.educationcounts.govt.nz/data-services/glossary#G", "education-li": "https://www.educationcounts.govt.nz/topics/ministry-of-education-library/education-library", "full-set-of-": "https://www.educationcounts.govt.nz/topics/bes/resources/bes-programme/full-set-of-bess", "timss-(trend": "https://www.educationcounts.govt.nz/data-services/data-collections/international/timss", "e-learning": "https://www.educationcounts.govt.nz/publications/ict", "statistics:-": "https://www.educationcounts.govt.nz/topics/national-education/school-leavers-with-ncea-level-2-or-above", "sdr-(single-": "https://www.educationcounts.govt.nz/data-services/data-collections/national/sdr", "m\\u0101ori-langua": "https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling/6040", "talis": "/data-services/data-collections/talis", "code-sets-&-": "https://www.educationcounts.govt.nz/data-services/collecting-information/code-sets-and-classifications", "useful-links": "https://www.educationcounts.govt.nz/topics/bes/useful-links-and-publications", "life-after-s": "https://www.educationcounts.govt.nz/statistics/tertiary_education/life_after_study", "pirls-(progr": "https://www.educationcounts.govt.nz/data-services/data-collections/international/pirls", "o": "https://www.educationcounts.govt.nz/data-services/glossary#O", "language-use": "https://www.educationcounts.govt.nz/statistics/early-childhood-education/language-use-in-ece", "s": "https://www.educationcounts.govt.nz/data-services/glossary#S", "pasifika-in-": "https://www.educationcounts.govt.nz/statistics/pasifika-education/pasifika-in-schooling", "key_accordio": "https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases/key_accordion", "number-of-sc": "https://www.educationcounts.govt.nz/statistics/schooling/number-of-schools", "w": "https://www.educationcounts.govt.nz/data-services/glossary#W", "bes-exemplar": "https://www.educationcounts.govt.nz/topics/bes/useful-links-and-publications/bes-exemplars", "soik-(studen": "https://www.educationcounts.govt.nz/topics/research/6858", "the-use-of-e": "https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on/the-use-of-evidence-in-policy", "skip-to-cont": "#content", "resourcing": "https://www.educationcounts.govt.nz/statistics/schooling/resourcing", "skip-to-seco": "#secondary-nav", "collection-f": "https://www.educationcounts.govt.nz/data-services/collecting-information/collection-forms", "m\\u0101ori-in-sch": "https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling", "schooling": "https://www.educationcounts.govt.nz/statistics/schooling", "early-learni": "https://www.educationcounts.govt.nz/find-an-els", "developing-c": "https://www.educationcounts.govt.nz/topics/bes/Whats-New/developing-communities-of-mathematical-inquiry", "\\npublication": "https://www.educationcounts.govt.nz/publications", "indicators-h": "https://www.educationcounts.govt.nz/indicators", "benefits-for": "https://www.educationcounts.govt.nz/statistics/international-education/benefits-of-international-education-for-nz2", "educational-": "https://www.educationcounts.govt.nz/data-services/directories", "single-data-": "https://www.educationcounts.govt.nz/data-services/data-collections/sdr", "tertiary": "https://www.educationcounts.govt.nz/publications/80898", "developing-m": "https://www.educationcounts.govt.nz/topics/bes/developing-mathematical-inquiry-communities", "accessibilit": "/site-info/accessibility", "statistics": "https://www.educationcounts.govt.nz/statistics", "integrated-s": "https://www.educationcounts.govt.nz/data-services/data-collections/national/integrated_student_loan_dataset", "about-bes": "https://www.educationcounts.govt.nz/topics/bes/about-bes", "special-educ": "https://www.educationcounts.govt.nz/statistics/special-education", "rt:lit": "https://www.educationcounts.govt.nz/data-services/data-collections/national/rtlit", "student-enga": "https://www.educationcounts.govt.nz/data-services/data-collections/national/student_engagement", "indicators": "https://www.educationcounts.govt.nz/indicators", "pasifika": "https://www.educationcounts.govt.nz/publications/pasifika", "finances": "https://www.educationcounts.govt.nz/statistics/early-childhood-education/finances", "financial-su": "https://www.educationcounts.govt.nz/statistics/tertiary_education/financial_support_for_students", "a": "https://www.educationcounts.govt.nz/data-services/glossary#A", "directories-": "https://www.educationcounts.govt.nz/data-services/directories/6136/directories", "curriculum": "https://www.educationcounts.govt.nz/publications/curriculum", "c": "https://www.educationcounts.govt.nz/data-services/glossary#C", "research-rec": "https://www.educationcounts.govt.nz/topics/research/52109", "\\nfind-a-scho": "https://www.educationcounts.govt.nz/find-school", "bes-(what-wo": "/topics/bes", "financial-pe": "https://www.educationcounts.govt.nz/statistics/tertiary_education/financial_performance", "bess-&-cases": "https://www.educationcounts.govt.nz/topics/bes/resources/bes-exemplars/bess-and-cases", "school-stati": "https://www.educationcounts.govt.nz/data-services/data-collections/national/school-statistics-monitoring-committee", "m\\u0101ori": "https://www.educationcounts.govt.nz/publications/maori", "bes-what-wor": "https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on", "f": "https://www.educationcounts.govt.nz/data-services/glossary#F", "glossary": "https://www.educationcounts.govt.nz/data-services/glossary", "public-achie": "https://www.educationcounts.govt.nz/topics/national-education", "j": "https://www.educationcounts.govt.nz/data-services/glossary#J", "n": "https://www.educationcounts.govt.nz/data-services/glossary#N", "pasifika-edu": "https://www.educationcounts.govt.nz/statistics/pasifika-education/progress_against_pasifika_education_plan_targets", "r": "https://www.educationcounts.govt.nz/data-services/glossary#R", "resources": "https://www.educationcounts.govt.nz/statistics/tertiary_education/resources", "v": "https://www.educationcounts.govt.nz/data-services/glossary#V", "z": "https://www.educationcounts.govt.nz/data-services/glossary#Z", "k": "https://www.educationcounts.govt.nz/data-services/glossary#K", "\\nindicators\\n": "https://www.educationcounts.govt.nz/indicators", "scroll-to-to": "#masthead", "transition-f": "https://www.educationcounts.govt.nz/statistics/tertiary-education/transition-from-school-to-tertiary", "students\'-in": "https://www.educationcounts.govt.nz/statistics/international-education/students-international-learning2", "pirls": "/data-services/data-collections/pirls", "spotlight-on": "https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on/spotlight-on-leadership", "links": "/site-info/links", "topics": "https://www.educationcounts.govt.nz/topics", "18-year-olds": "https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment/18-year-olds-with-level-2-or-equivalent", "new-zealand-": "https://www.educationcounts.govt.nz/data-services/directories/list-of-nz-schools", "skip-to-sear": "#site-search-keyword", "nemp-": "https://www.educationcounts.govt.nz/data-services/data-collections/national/nemp", "latest-publi": "http://www.educationcounts.govt.nz/publications?SQ_PAINT_LAYOUT_NAME=all-chronological", "what\'s-new": "https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases/whats-new", "nemp": "/data-services/data-collections/nemp", "m\\u0101ori-medium": "https://www.educationcounts.govt.nz/data-services/directories/maori-medium-schools", "timss": "/data-services/data-collections/timss", "school-sms-r": "https://www.educationcounts.govt.nz/data-services/collecting-information/school-sms-roll-returns-2015", "close-menu": "#secondary-nav", "q": "https://www.educationcounts.govt.nz/data-services/glossary#Q", "ncea-attainm": "https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment/ncea-attainment", "national": "https://www.educationcounts.govt.nz/data-services/data-collections/national", "education-co": "/", "summaries-of": "https://www.educationcounts.govt.nz/topics/bes/resources/bes-programme", "data-collect": "https://www.educationcounts.govt.nz/data-services/data-collections", "programme-fo": "https://www.educationcounts.govt.nz/data-services/data-collections/international/piaac", "national-sta": "https://www.educationcounts.govt.nz/statistics/schooling/national-standards", "early-childh": "https://www.educationcounts.govt.nz/data-services/directories/early-childhood-services", "services": "https://www.educationcounts.govt.nz/statistics/early-childhood-education/services", "studylink:-s": "https://www.educationcounts.govt.nz/topics/26298/studylink-website", "site-map": "/site-info/site-map", "retention-&-": "https://www.educationcounts.govt.nz/statistics/tertiary_education/retention_and_achievement", "national-mon": "https://www.educationcounts.govt.nz/topics/research/nmssa", "e": "https://www.educationcounts.govt.nz/data-services/glossary#E", "school-merge": "https://www.educationcounts.govt.nz/data-services/directories/6136", "i": "https://www.educationcounts.govt.nz/data-services/glossary#I", "board-of-tru": "https://www.educationcounts.govt.nz/data-services/data-collections/boards_of_trustees", "private-scho": "https://www.educationcounts.govt.nz/data-services/directories/private-schools", "m": "https://www.educationcounts.govt.nz/data-services/glossary#M", "tertiary-edu": "https://www.educationcounts.govt.nz/statistics/tertiary_education", "\\nknow-your-r": "https://www.educationcounts.govt.nz/know-your-region", "u": "https://www.educationcounts.govt.nz/data-services/glossary#U", "school-enrol": "https://www.educationcounts.govt.nz/data-services/collecting-information/school-enrolment-zones", "y": "https://www.educationcounts.govt.nz/data-services/glossary#Y", "topics-home-": "https://www.educationcounts.govt.nz/topics", "study-awards": "https://www.educationcounts.govt.nz/topics/research/16721", "inland-reven": "https://www.educationcounts.govt.nz/topics/26298/inland-revenue-website"}'
In [11]:
savjson = open('/home/wcmckee/educount/educationcounts-url.json', 'w')

savjson.write(json.dumps(gidict))

savjson.close()
In [11]:
 
In [12]:
for tagz in tagliz:
    print tagz
['']
['']
['']
['']
['']
['know-your-region']
['find-an-els']
['find-school']
['topics']
['topics']
['topics/BES']
['topics/ict_themes']
['topics/international-education']
['topics/ministry-of-education-library']
['topics/31351']
['topics/pasifika_education']
['topics/national-education']
['topics/research']
['topics/26298']
['indicators']
['publications']
['statistics']
['statistics']
['statistics/early-childhood-education']
['statistics/early-childhood-education/annual-ece-summary-reports']
['statistics/early-childhood-education/participation']
['statistics/early-childhood-education/services']
['statistics/early-childhood-education/finances']
['statistics/early-childhood-education/staffing']
['statistics/early-childhood-education/language-use-in-ece']
['statistics/schooling']
['statistics/schooling/student-numbers']
['statistics/schooling/number-of-schools']
['statistics/schooling/national-standards/National_Standards']
['statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results']
['statistics/schooling/senior-student-attainment']
['statistics/schooling/teaching_staff']
['statistics/schooling/resourcing']
['statistics/schooling/board_of_trustees']
['statistics/tertiary-education']
['statistics/tertiary-education/transition-from-school-to-tertiary']
['statistics/tertiary-education/participation']
['statistics/tertiary-education/retention_and_achievement']
['statistics/tertiary-education/research']
['statistics/tertiary-education/resources']
['statistics/tertiary-education/financial_performance']
['statistics/tertiary-education/financial_support_for_students']
['statistics/tertiary-education/life_after_study']
['statistics/tertiary-education/summary_tables']
['statistics/tertiary-education/university-rankings']
['statistics/maori-education']
['statistics/maori-education/maori-in-schooling']
['statistics/maori-education/tertiary-education']
['statistics/pasifika-education']
['statistics/pasifika-education/progress_against_pasifika_education_plan_targets']
['statistics/archived/pasifika-in-schooling']
['statistics/pasifika-education/tertiary-education']
['statistics/international-education']
['statistics/international-education/students-international-learning2']
['statistics/international-education/international-students-in-new-zealand']
['statistics/international-education/internationalisation-of-education-providers-in-nz2']
['statistics/international-education/benefits-of-international-education-for-nz2']
['statistics/special-education']
['statistics/special-education/ongoing-resourcing-scheme']
['data-services']
['data-services']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/glossary']
['data-services/collecting-information']
['data-services/collecting-information/code-sets-and-classifications']
['data-services/collecting-information/collection-forms']
['data-services/collecting-information/guidelines']
['data-services/collecting-information/school-enrolment-zones']
['data-services/collecting-information/school-sms-roll-returns-2015']
['data-services/collecting-information/sms_roll_returns']
['data-services/data-collections/national']
['data-services/data-collections/ece_staff_return']
['data-services/data-collections/boards_of_trustees']
['data-services/data-collections/ecesmc']
['data-services/data-collections/integrated_student_loan_dataset']
['school/running-a-school/reporting']
['data-services/data-collections/nemp']
['data-services/data-collections/reading-recovery-electronic-returns']
['data-services/data-collections/rtlit']
['data-services/data-collections/school_leavers']
['data-services/data-collections/school-roll-return']
['data-services/data-collections/school-statistics-monitoring-committee']
['data-services/data-collections/sdr']
['data-services/data-collections/student_engagement']
['data-services/data-collections/teacher_census']
['data-services/data-collections/tertiary_enrolment_data']
['data-services/data-collections/international']
['data-services/data-collections/all']
['data-services/data-collections/iccs_data']
['data-services/data-collections/piaac']
['data-services/data-collections/pirls']
['data-services/data-collections/pisa']
['data-services/data-collections/talis']
['data-services/data-collections/timss']
['data-services/directories']
['data-services/directories']
['data-services/directories']
['topics/national-education']
['statistics/schooling/national-standards']
['publications']
['data-services/data-collections']
['topics/bes']
['theMinistry/EducationInitiatives/InvestingInEducationalSuccess.aspx']
['know-your-region']
['find-school']
['find-an-els']
['topics']
['indicators']
['publications']
['statistics']
['data-services']
['']
['']
['know-your-region']
['find-school']
['find-an-els']
['topics']
['topics/bes']
['topics/bes/developing-mathematical-inquiry-communities']
['topics/bes/Whats-New']
['topics/bes/Whats-New/deakerberryman-interview']
['topics/bes/Whats-New/full-set-of-bess']
['topics/bes/Whats-New/bes-exemplars']
['topics/bes/Whats-New/developing-communities-of-mathematical-inquiry']
['topics/bes/resources']
['topics/bes/resources/bes-exemplars']
['topics/bes/resources/bes-exemplars/full-set-of-bess2']
['topics/bes/resources/bes-exemplars/bess-and-cases']
['topics/bes/resources/bes-exemplars/whats-new']
['topics/bes/resources/bess-and-cases']
['topics/bes/resources/bess-and-cases/key_accordion']
['topics/bes/resources/bess-and-cases/whats-new']
['topics/bes/resources/bess-and-cases/bes-exemplars']
['topics/bes/resources/bes-programme']
['topics/bes/resources/bes-programme/bes-exemplars']
['topics/bes/resources/bes-programme/full-set-of-bess']
['topics/bes/resources/spotlight-on']
['topics/bes/resources/spotlight-on/spotlight-on-counter-bullying-pedagogies']
['topics/bes/resources/spotlight-on/spotlight-on-mathematics-pangarau']
['topics/bes/resources/spotlight-on/spotlight-on-leadership']
['topics/bes/resources/spotlight-on/the-use-of-evidence-in-policy']
['topics/bes/useful-links-and-publications']
['topics/bes/useful-links-and-publications/bes-exemplars']
['topics/bes/about-bes']
['topics/ict_themes']
['topics/international-education']
['topics/ministry-of-education-library']
['topics/ministry-of-education-library/education-library']
['topics/31351']
['topics/pasifika_education']
['topics/national-education']
['topics/national-education/ece-participation-statistics2']
['topics/national-education/18-year-olds-with-a-minimum-of-ncea-level-2-or-equivalent']
['topics/national-education/school-leavers-with-ncea-level-2-or-above']
['topics/national-education/national-standards2']
['topics/national-education/nga-whanaketanga']
['topics/national-education/public-achievement-information']
['topics/research']
['topics/research/52109']
['topics/research/all']
['topics/research/iccs_data']
['topics/research/nmssa']
['topics/research/piaac']
['topics/research/pirls']
['topics/research/pisa']
['topics/research/6858']
['topics/research/6858/6578']
['topics/research/16721']
['topics/research/talis']
['topics/research/timss']
['topics/research/research_division']
['topics/26298']
['topics/26298/ministry-of-education-student-loans']
['topics/26298/statistics-nz-student-loans']
['topics/26298/studylink-website']
['topics/26298/inland-revenue-website']
['indicators']
['publications']
['publications/series']
['publications/ECE']
['publications/schooling']
['publications/80898']
['publications/special_education']
['publications/maori']
['publications/maori/105966']
['publications/maori/english-medium-education']
['publications/maori/maori-medium-and-english-medium']
['publications/pasifika']
['publications/international']
['publications/ict']
['publications/curriculum']
['publications/literacy']
['publications/numeracy']
['statistics']
['statistics/early-childhood-education']
['statistics/early-childhood-education/annual-ece-summary-reports']
['statistics/early-childhood-education/participation']
['statistics/early-childhood-education/services']
['statistics/early-childhood-education/finances']
['statistics/early-childhood-education/staffing']
['statistics/early-childhood-education/language-use-in-ece']
['statistics/schooling']
['statistics/schooling/student-numbers']
['statistics/schooling/number-of-schools']
['statistics/schooling/national-standards']
['statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results']
['statistics/schooling/senior-student-attainment']
['statistics/schooling/senior-student-attainment/school-leavers2']
['statistics/schooling/senior-student-attainment/ncea-attainment']
['statistics/schooling/senior-student-attainment/18-year-olds-with-level-2-or-equivalent']
['statistics/schooling/teaching_staff']
['statistics/schooling/resourcing']
['statistics/schooling/board_of_trustees']
['statistics/tertiary_education']
['statistics/tertiary_education/transition-from-school-to-tertiary']
['statistics/tertiary_education/participation']
['statistics/tertiary_education/retention_and_achievement']
['statistics/tertiary_education/research']
['statistics/tertiary_education/resources']
['statistics/tertiary_education/financial_performance']
['statistics/tertiary_education/financial_support_for_students']
['statistics/tertiary_education/life_after_study']
['statistics/tertiary_education/summary_tables']
['statistics/tertiary_education/university-rankings']
['statistics/maori-education']
['statistics/maori-education/maori-in-schooling']
['statistics/maori-education/maori-in-schooling/6040']
['statistics/maori-education/maori-in-schooling/participation-and-attainment-of-maori-students-in-national-certificate-of-educational-achievement']
['statistics/maori-education/tertiary-education']
['statistics/pasifika-education']
['statistics/pasifika-education/progress_against_pasifika_education_plan_targets']
['statistics/pasifika-education/pasifika-in-schooling']
['statistics/pasifika-education/tertiary-education']
['statistics/international-education']
['statistics/international-education/international-students-in-new-zealand']
['statistics/international-education/internationalisation-of-education-providers-in-nz2']
['statistics/international-education/benefits-of-international-education-for-nz2']
['statistics/international-education/students-international-learning2']
['statistics/special-education']
['statistics/special-education/ongoing-resourcing-scheme']
['data-services']
['data-services/collecting-information']
['data-services/collecting-information/code-sets-and-classifications']
['data-services/collecting-information/collection-forms']
['data-services/collecting-information/guidelines']
['data-services/collecting-information/school-enrolment-zones']
['data-services/collecting-information/school-sms-roll-returns-2015']
['data-services/collecting-information/sms_roll_returns']
['data-services/data-collections']
['data-services/data-collections/all']
['data-services/data-collections/ece_staff_return']
['data-services/data-collections/boards_of_trustees']
['data-services/data-collections/ecesmc']
['data-services/data-collections/iccs_data']
['data-services/data-collections/integrated_student_loan_dataset']
['data-services/data-collections/nemp']
['data-services/data-collections/piaac']
['data-services/data-collections/pirls']
['data-services/data-collections/pisa']
['data-services/data-collections/reading-recovery-electronic-returns']
['data-services/data-collections/rtlit']
['data-services/data-collections/school_leavers']
['data-services/data-collections/school-roll-return']
['data-services/data-collections/school-statistics-monitoring-committee']
['data-services/data-collections/sdr']
['data-services/data-collections/student_engagement']
['data-services/data-collections/talis']
['data-services/data-collections/teacher_census']
['data-services/data-collections/tertiary_enrolment_data']
['data-services/data-collections/timss']
['data-services/data-collections/national']
['data-services/data-collections/national/ece_staff_return']
['data-services/data-collections/national/boards_of_trustees']
['data-services/data-collections/national/ecesmc']
['data-services/data-collections/national/integrated_student_loan_dataset']
['data-services/data-collections/national/nemp']
['data-services/data-collections/national/reading-recovery-electronic-returns']
['data-services/data-collections/national/rtlit']
['data-services/data-collections/national/school_leavers']
['data-services/data-collections/national/school-roll-return']
['data-services/data-collections/national/school-statistics-monitoring-committee']
['data-services/data-collections/national/sdr']
['data-services/data-collections/national/student_engagement']
['data-services/data-collections/national/teacher_census']
['data-services/data-collections/national/tertiary_enrolment_data']
['data-services/data-collections/international']
['data-services/data-collections/international/all']
['data-services/data-collections/international/iccs_data']
['data-services/data-collections/international/piaac']
['data-services/data-collections/international/pirls']
['data-services/data-collections/international/pisa']
['data-services/data-collections/international/talis']
['data-services/data-collections/international/timss']
['data-services/directories']
['data-services/directories/early-childhood-services']
['data-services/directories/early-childhood-services/ministry-of-education-20-hours-ece']
['data-services/directories/maori-medium-schools']
['data-services/directories/maori-medium-schools/te-kete-ipurangi']
['data-services/directories/list-of-nz-schools']
['data-services/directories/private-schools']
['data-services/directories/6136']
['data-services/directories/6136/directories']
['data-services/directories/list-of-tertiary-providers']
['data-services/glossary']
['site-info/site-map']
['site-info/contact-us']
['site-info/about-this-site']
['site-info/accessibility']
['site-info/privacy']
['site-info/links']
['']
['']
['']
In [13]:
#[x.strip() for x in o.split(',')]
In [13]:
 
In [14]:
for tagz in taglisz:
    print [tagz.strip() for tagz in tagz.split(',')]
    tagliz.append([tagz.strip() for tagz in tagz.split(',')])
In [15]:
tagliz
Out[15]:
[[''],
 [''],
 [''],
 [''],
 [''],
 ['know-your-region'],
 ['find-an-els'],
 ['find-school'],
 ['topics'],
 ['topics'],
 ['topics/BES'],
 ['topics/ict_themes'],
 ['topics/international-education'],
 ['topics/ministry-of-education-library'],
 ['topics/31351'],
 ['topics/pasifika_education'],
 ['topics/national-education'],
 ['topics/research'],
 ['topics/26298'],
 ['indicators'],
 ['publications'],
 ['statistics'],
 ['statistics'],
 ['statistics/early-childhood-education'],
 ['statistics/early-childhood-education/annual-ece-summary-reports'],
 ['statistics/early-childhood-education/participation'],
 ['statistics/early-childhood-education/services'],
 ['statistics/early-childhood-education/finances'],
 ['statistics/early-childhood-education/staffing'],
 ['statistics/early-childhood-education/language-use-in-ece'],
 ['statistics/schooling'],
 ['statistics/schooling/student-numbers'],
 ['statistics/schooling/number-of-schools'],
 ['statistics/schooling/national-standards/National_Standards'],
 ['statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results'],
 ['statistics/schooling/senior-student-attainment'],
 ['statistics/schooling/teaching_staff'],
 ['statistics/schooling/resourcing'],
 ['statistics/schooling/board_of_trustees'],
 ['statistics/tertiary-education'],
 ['statistics/tertiary-education/transition-from-school-to-tertiary'],
 ['statistics/tertiary-education/participation'],
 ['statistics/tertiary-education/retention_and_achievement'],
 ['statistics/tertiary-education/research'],
 ['statistics/tertiary-education/resources'],
 ['statistics/tertiary-education/financial_performance'],
 ['statistics/tertiary-education/financial_support_for_students'],
 ['statistics/tertiary-education/life_after_study'],
 ['statistics/tertiary-education/summary_tables'],
 ['statistics/tertiary-education/university-rankings'],
 ['statistics/maori-education'],
 ['statistics/maori-education/maori-in-schooling'],
 ['statistics/maori-education/tertiary-education'],
 ['statistics/pasifika-education'],
 ['statistics/pasifika-education/progress_against_pasifika_education_plan_targets'],
 ['statistics/archived/pasifika-in-schooling'],
 ['statistics/pasifika-education/tertiary-education'],
 ['statistics/international-education'],
 ['statistics/international-education/students-international-learning2'],
 ['statistics/international-education/international-students-in-new-zealand'],
 ['statistics/international-education/internationalisation-of-education-providers-in-nz2'],
 ['statistics/international-education/benefits-of-international-education-for-nz2'],
 ['statistics/special-education'],
 ['statistics/special-education/ongoing-resourcing-scheme'],
 ['data-services'],
 ['data-services'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/glossary'],
 ['data-services/collecting-information'],
 ['data-services/collecting-information/code-sets-and-classifications'],
 ['data-services/collecting-information/collection-forms'],
 ['data-services/collecting-information/guidelines'],
 ['data-services/collecting-information/school-enrolment-zones'],
 ['data-services/collecting-information/school-sms-roll-returns-2015'],
 ['data-services/collecting-information/sms_roll_returns'],
 ['data-services/data-collections/national'],
 ['data-services/data-collections/ece_staff_return'],
 ['data-services/data-collections/boards_of_trustees'],
 ['data-services/data-collections/ecesmc'],
 ['data-services/data-collections/integrated_student_loan_dataset'],
 ['school/running-a-school/reporting'],
 ['data-services/data-collections/nemp'],
 ['data-services/data-collections/reading-recovery-electronic-returns'],
 ['data-services/data-collections/rtlit'],
 ['data-services/data-collections/school_leavers'],
 ['data-services/data-collections/school-roll-return'],
 ['data-services/data-collections/school-statistics-monitoring-committee'],
 ['data-services/data-collections/sdr'],
 ['data-services/data-collections/student_engagement'],
 ['data-services/data-collections/teacher_census'],
 ['data-services/data-collections/tertiary_enrolment_data'],
 ['data-services/data-collections/international'],
 ['data-services/data-collections/all'],
 ['data-services/data-collections/iccs_data'],
 ['data-services/data-collections/piaac'],
 ['data-services/data-collections/pirls'],
 ['data-services/data-collections/pisa'],
 ['data-services/data-collections/talis'],
 ['data-services/data-collections/timss'],
 ['data-services/directories'],
 ['data-services/directories'],
 ['data-services/directories'],
 ['topics/national-education'],
 ['statistics/schooling/national-standards'],
 ['publications'],
 ['data-services/data-collections'],
 ['topics/bes'],
 ['theMinistry/EducationInitiatives/InvestingInEducationalSuccess.aspx'],
 ['know-your-region'],
 ['find-school'],
 ['find-an-els'],
 ['topics'],
 ['indicators'],
 ['publications'],
 ['statistics'],
 ['data-services'],
 [''],
 [''],
 ['know-your-region'],
 ['find-school'],
 ['find-an-els'],
 ['topics'],
 ['topics/bes'],
 ['topics/bes/developing-mathematical-inquiry-communities'],
 ['topics/bes/Whats-New'],
 ['topics/bes/Whats-New/deakerberryman-interview'],
 ['topics/bes/Whats-New/full-set-of-bess'],
 ['topics/bes/Whats-New/bes-exemplars'],
 ['topics/bes/Whats-New/developing-communities-of-mathematical-inquiry'],
 ['topics/bes/resources'],
 ['topics/bes/resources/bes-exemplars'],
 ['topics/bes/resources/bes-exemplars/full-set-of-bess2'],
 ['topics/bes/resources/bes-exemplars/bess-and-cases'],
 ['topics/bes/resources/bes-exemplars/whats-new'],
 ['topics/bes/resources/bess-and-cases'],
 ['topics/bes/resources/bess-and-cases/key_accordion'],
 ['topics/bes/resources/bess-and-cases/whats-new'],
 ['topics/bes/resources/bess-and-cases/bes-exemplars'],
 ['topics/bes/resources/bes-programme'],
 ['topics/bes/resources/bes-programme/bes-exemplars'],
 ['topics/bes/resources/bes-programme/full-set-of-bess'],
 ['topics/bes/resources/spotlight-on'],
 ['topics/bes/resources/spotlight-on/spotlight-on-counter-bullying-pedagogies'],
 ['topics/bes/resources/spotlight-on/spotlight-on-mathematics-pangarau'],
 ['topics/bes/resources/spotlight-on/spotlight-on-leadership'],
 ['topics/bes/resources/spotlight-on/the-use-of-evidence-in-policy'],
 ['topics/bes/useful-links-and-publications'],
 ['topics/bes/useful-links-and-publications/bes-exemplars'],
 ['topics/bes/about-bes'],
 ['topics/ict_themes'],
 ['topics/international-education'],
 ['topics/ministry-of-education-library'],
 ['topics/ministry-of-education-library/education-library'],
 ['topics/31351'],
 ['topics/pasifika_education'],
 ['topics/national-education'],
 ['topics/national-education/ece-participation-statistics2'],
 ['topics/national-education/18-year-olds-with-a-minimum-of-ncea-level-2-or-equivalent'],
 ['topics/national-education/school-leavers-with-ncea-level-2-or-above'],
 ['topics/national-education/national-standards2'],
 ['topics/national-education/nga-whanaketanga'],
 ['topics/national-education/public-achievement-information'],
 ['topics/research'],
 ['topics/research/52109'],
 ['topics/research/all'],
 ['topics/research/iccs_data'],
 ['topics/research/nmssa'],
 ['topics/research/piaac'],
 ['topics/research/pirls'],
 ['topics/research/pisa'],
 ['topics/research/6858'],
 ['topics/research/6858/6578'],
 ['topics/research/16721'],
 ['topics/research/talis'],
 ['topics/research/timss'],
 ['topics/research/research_division'],
 ['topics/26298'],
 ['topics/26298/ministry-of-education-student-loans'],
 ['topics/26298/statistics-nz-student-loans'],
 ['topics/26298/studylink-website'],
 ['topics/26298/inland-revenue-website'],
 ['indicators'],
 ['publications'],
 ['publications/series'],
 ['publications/ECE'],
 ['publications/schooling'],
 ['publications/80898'],
 ['publications/special_education'],
 ['publications/maori'],
 ['publications/maori/105966'],
 ['publications/maori/english-medium-education'],
 ['publications/maori/maori-medium-and-english-medium'],
 ['publications/pasifika'],
 ['publications/international'],
 ['publications/ict'],
 ['publications/curriculum'],
 ['publications/literacy'],
 ['publications/numeracy'],
 ['statistics'],
 ['statistics/early-childhood-education'],
 ['statistics/early-childhood-education/annual-ece-summary-reports'],
 ['statistics/early-childhood-education/participation'],
 ['statistics/early-childhood-education/services'],
 ['statistics/early-childhood-education/finances'],
 ['statistics/early-childhood-education/staffing'],
 ['statistics/early-childhood-education/language-use-in-ece'],
 ['statistics/schooling'],
 ['statistics/schooling/student-numbers'],
 ['statistics/schooling/number-of-schools'],
 ['statistics/schooling/national-standards'],
 ['statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results'],
 ['statistics/schooling/senior-student-attainment'],
 ['statistics/schooling/senior-student-attainment/school-leavers2'],
 ['statistics/schooling/senior-student-attainment/ncea-attainment'],
 ['statistics/schooling/senior-student-attainment/18-year-olds-with-level-2-or-equivalent'],
 ['statistics/schooling/teaching_staff'],
 ['statistics/schooling/resourcing'],
 ['statistics/schooling/board_of_trustees'],
 ['statistics/tertiary_education'],
 ['statistics/tertiary_education/transition-from-school-to-tertiary'],
 ['statistics/tertiary_education/participation'],
 ['statistics/tertiary_education/retention_and_achievement'],
 ['statistics/tertiary_education/research'],
 ['statistics/tertiary_education/resources'],
 ['statistics/tertiary_education/financial_performance'],
 ['statistics/tertiary_education/financial_support_for_students'],
 ['statistics/tertiary_education/life_after_study'],
 ['statistics/tertiary_education/summary_tables'],
 ['statistics/tertiary_education/university-rankings'],
 ['statistics/maori-education'],
 ['statistics/maori-education/maori-in-schooling'],
 ['statistics/maori-education/maori-in-schooling/6040'],
 ['statistics/maori-education/maori-in-schooling/participation-and-attainment-of-maori-students-in-national-certificate-of-educational-achievement'],
 ['statistics/maori-education/tertiary-education'],
 ['statistics/pasifika-education'],
 ['statistics/pasifika-education/progress_against_pasifika_education_plan_targets'],
 ['statistics/pasifika-education/pasifika-in-schooling'],
 ['statistics/pasifika-education/tertiary-education'],
 ['statistics/international-education'],
 ['statistics/international-education/international-students-in-new-zealand'],
 ['statistics/international-education/internationalisation-of-education-providers-in-nz2'],
 ['statistics/international-education/benefits-of-international-education-for-nz2'],
 ['statistics/international-education/students-international-learning2'],
 ['statistics/special-education'],
 ['statistics/special-education/ongoing-resourcing-scheme'],
 ['data-services'],
 ['data-services/collecting-information'],
 ['data-services/collecting-information/code-sets-and-classifications'],
 ['data-services/collecting-information/collection-forms'],
 ['data-services/collecting-information/guidelines'],
 ['data-services/collecting-information/school-enrolment-zones'],
 ['data-services/collecting-information/school-sms-roll-returns-2015'],
 ['data-services/collecting-information/sms_roll_returns'],
 ['data-services/data-collections'],
 ['data-services/data-collections/all'],
 ['data-services/data-collections/ece_staff_return'],
 ['data-services/data-collections/boards_of_trustees'],
 ['data-services/data-collections/ecesmc'],
 ['data-services/data-collections/iccs_data'],
 ['data-services/data-collections/integrated_student_loan_dataset'],
 ['data-services/data-collections/nemp'],
 ['data-services/data-collections/piaac'],
 ['data-services/data-collections/pirls'],
 ['data-services/data-collections/pisa'],
 ['data-services/data-collections/reading-recovery-electronic-returns'],
 ['data-services/data-collections/rtlit'],
 ['data-services/data-collections/school_leavers'],
 ['data-services/data-collections/school-roll-return'],
 ['data-services/data-collections/school-statistics-monitoring-committee'],
 ['data-services/data-collections/sdr'],
 ['data-services/data-collections/student_engagement'],
 ['data-services/data-collections/talis'],
 ['data-services/data-collections/teacher_census'],
 ['data-services/data-collections/tertiary_enrolment_data'],
 ['data-services/data-collections/timss'],
 ['data-services/data-collections/national'],
 ['data-services/data-collections/national/ece_staff_return'],
 ['data-services/data-collections/national/boards_of_trustees'],
 ['data-services/data-collections/national/ecesmc'],
 ['data-services/data-collections/national/integrated_student_loan_dataset'],
 ['data-services/data-collections/national/nemp'],
 ['data-services/data-collections/national/reading-recovery-electronic-returns'],
 ['data-services/data-collections/national/rtlit'],
 ['data-services/data-collections/national/school_leavers'],
 ['data-services/data-collections/national/school-roll-return'],
 ['data-services/data-collections/national/school-statistics-monitoring-committee'],
 ['data-services/data-collections/national/sdr'],
 ['data-services/data-collections/national/student_engagement'],
 ['data-services/data-collections/national/teacher_census'],
 ['data-services/data-collections/national/tertiary_enrolment_data'],
 ['data-services/data-collections/international'],
 ['data-services/data-collections/international/all'],
 ['data-services/data-collections/international/iccs_data'],
 ['data-services/data-collections/international/piaac'],
 ['data-services/data-collections/international/pirls'],
 ['data-services/data-collections/international/pisa'],
 ['data-services/data-collections/international/talis'],
 ['data-services/data-collections/international/timss'],
 ['data-services/directories'],
 ['data-services/directories/early-childhood-services'],
 ['data-services/directories/early-childhood-services/ministry-of-education-20-hours-ece'],
 ['data-services/directories/maori-medium-schools'],
 ['data-services/directories/maori-medium-schools/te-kete-ipurangi'],
 ['data-services/directories/list-of-nz-schools'],
 ['data-services/directories/private-schools'],
 ['data-services/directories/6136'],
 ['data-services/directories/6136/directories'],
 ['data-services/directories/list-of-tertiary-providers'],
 ['data-services/glossary'],
 ['site-info/site-map'],
 ['site-info/contact-us'],
 ['site-info/about-this-site'],
 ['site-info/accessibility'],
 ['site-info/privacy'],
 ['site-info/links'],
 [''],
 [''],
 ['']]
In [15]:
 
In [15]:
 
In [16]:
urldict = dict()
In [17]:
for ed in edu:
    #print ed.text.replace(' ', '-')
    o = urlparse(ed.attrs['href'])
    #change this path so that 
    #
    print o.path
    #print ed.text
    
    
    #print ed.attrs['href']
    urldict.update({ed.text.replace(' ', '-') :  ed.attrs['href']})
    
/




/know-your-region
/find-an-els
/find-school
/topics
/topics
/topics/BES
/topics/ict_themes
/topics/international-education
/topics/ministry-of-education-library
/topics/31351
/topics/pasifika_education
/topics/national-education
/topics/research
/topics/26298
/indicators
/publications
/statistics
/statistics
/statistics/early-childhood-education
/statistics/early-childhood-education/annual-ece-summary-reports
/statistics/early-childhood-education/participation
/statistics/early-childhood-education/services
/statistics/early-childhood-education/finances
/statistics/early-childhood-education/staffing
/statistics/early-childhood-education/language-use-in-ece
/statistics/schooling
/statistics/schooling/student-numbers
/statistics/schooling/number-of-schools
/statistics/schooling/national-standards/National_Standards
/statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results
/statistics/schooling/senior-student-attainment
/statistics/schooling/teaching_staff
/statistics/schooling/resourcing
/statistics/schooling/board_of_trustees
/statistics/tertiary-education
/statistics/tertiary-education/transition-from-school-to-tertiary
/statistics/tertiary-education/participation
/statistics/tertiary-education/retention_and_achievement
/statistics/tertiary-education/research
/statistics/tertiary-education/resources
/statistics/tertiary-education/financial_performance
/statistics/tertiary-education/financial_support_for_students
/statistics/tertiary-education/life_after_study
/statistics/tertiary-education/summary_tables
/statistics/tertiary-education/university-rankings
/statistics/maori-education
/statistics/maori-education/maori-in-schooling
/statistics/maori-education/tertiary-education
/statistics/pasifika-education
/statistics/pasifika-education/progress_against_pasifika_education_plan_targets
/statistics/archived/pasifika-in-schooling
/statistics/pasifika-education/tertiary-education
/statistics/international-education
/statistics/international-education/students-international-learning2
/statistics/international-education/international-students-in-new-zealand
/statistics/international-education/internationalisation-of-education-providers-in-nz2
/statistics/international-education/benefits-of-international-education-for-nz2
/statistics/special-education
/statistics/special-education/ongoing-resourcing-scheme
/data-services
/data-services
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/glossary
/data-services/collecting-information
/data-services/collecting-information/code-sets-and-classifications
/data-services/collecting-information/collection-forms
/data-services/collecting-information/guidelines
/data-services/collecting-information/school-enrolment-zones
/data-services/collecting-information/school-sms-roll-returns-2015
/data-services/collecting-information/sms_roll_returns
/data-services/data-collections/national
/data-services/data-collections/ece_staff_return
/data-services/data-collections/boards_of_trustees
/data-services/data-collections/ecesmc
/data-services/data-collections/integrated_student_loan_dataset
/school/running-a-school/reporting
/data-services/data-collections/nemp
/data-services/data-collections/reading-recovery-electronic-returns
/data-services/data-collections/rtlit
/data-services/data-collections/school_leavers
/data-services/data-collections/school-roll-return
/data-services/data-collections/school-statistics-monitoring-committee
/data-services/data-collections/sdr
/data-services/data-collections/student_engagement
/data-services/data-collections/teacher_census
/data-services/data-collections/tertiary_enrolment_data
/data-services/data-collections/international
/data-services/data-collections/all
/data-services/data-collections/iccs_data
/data-services/data-collections/piaac
/data-services/data-collections/pirls
/data-services/data-collections/pisa
/data-services/data-collections/talis
/data-services/data-collections/timss
/data-services/directories
/data-services/directories
/data-services/directories
/topics/national-education
/statistics/schooling/national-standards
/publications
/data-services/data-collections
/topics/bes
/theMinistry/EducationInitiatives/InvestingInEducationalSuccess.aspx
/know-your-region
/find-school
/find-an-els
/topics
/indicators
/publications
/statistics
/data-services
/

/know-your-region
/find-school
/find-an-els
/topics
/topics/bes
/topics/bes/developing-mathematical-inquiry-communities
/topics/bes/Whats-New
/topics/bes/Whats-New/deakerberryman-interview
/topics/bes/Whats-New/full-set-of-bess
/topics/bes/Whats-New/bes-exemplars
/topics/bes/Whats-New/developing-communities-of-mathematical-inquiry
/topics/bes/resources
/topics/bes/resources/bes-exemplars
/topics/bes/resources/bes-exemplars/full-set-of-bess2
/topics/bes/resources/bes-exemplars/bess-and-cases
/topics/bes/resources/bes-exemplars/whats-new
/topics/bes/resources/bess-and-cases
/topics/bes/resources/bess-and-cases/key_accordion
/topics/bes/resources/bess-and-cases/whats-new
/topics/bes/resources/bess-and-cases/bes-exemplars
/topics/bes/resources/bes-programme
/topics/bes/resources/bes-programme/bes-exemplars
/topics/bes/resources/bes-programme/full-set-of-bess
/topics/bes/resources/spotlight-on
/topics/bes/resources/spotlight-on/spotlight-on-counter-bullying-pedagogies
/topics/bes/resources/spotlight-on/spotlight-on-mathematics-pangarau
/topics/bes/resources/spotlight-on/spotlight-on-leadership
/topics/bes/resources/spotlight-on/the-use-of-evidence-in-policy
/topics/bes/useful-links-and-publications
/topics/bes/useful-links-and-publications/bes-exemplars
/topics/bes/about-bes
/topics/ict_themes
/topics/international-education
/topics/ministry-of-education-library
/topics/ministry-of-education-library/education-library
/topics/31351
/topics/pasifika_education
/topics/national-education
/topics/national-education/ece-participation-statistics2
/topics/national-education/18-year-olds-with-a-minimum-of-ncea-level-2-or-equivalent
/topics/national-education/school-leavers-with-ncea-level-2-or-above
/topics/national-education/national-standards2
/topics/national-education/nga-whanaketanga
/topics/national-education/public-achievement-information
/topics/research
/topics/research/52109
/topics/research/all
/topics/research/iccs_data
/topics/research/nmssa
/topics/research/piaac
/topics/research/pirls
/topics/research/pisa
/topics/research/6858
/topics/research/6858/6578
/topics/research/16721
/topics/research/talis
/topics/research/timss
/topics/research/research_division
/topics/26298
/topics/26298/ministry-of-education-student-loans
/topics/26298/statistics-nz-student-loans
/topics/26298/studylink-website
/topics/26298/inland-revenue-website
/indicators
/publications
/publications/series
/publications/ECE
/publications/schooling
/publications/80898
/publications/special_education
/publications/maori
/publications/maori/105966
/publications/maori/english-medium-education
/publications/maori/maori-medium-and-english-medium
/publications/pasifika
/publications/international
/publications/ict
/publications/curriculum
/publications/literacy
/publications/numeracy
/statistics
/statistics/early-childhood-education
/statistics/early-childhood-education/annual-ece-summary-reports
/statistics/early-childhood-education/participation
/statistics/early-childhood-education/services
/statistics/early-childhood-education/finances
/statistics/early-childhood-education/staffing
/statistics/early-childhood-education/language-use-in-ece
/statistics/schooling
/statistics/schooling/student-numbers
/statistics/schooling/number-of-schools
/statistics/schooling/national-standards
/statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results
/statistics/schooling/senior-student-attainment
/statistics/schooling/senior-student-attainment/school-leavers2
/statistics/schooling/senior-student-attainment/ncea-attainment
/statistics/schooling/senior-student-attainment/18-year-olds-with-level-2-or-equivalent
/statistics/schooling/teaching_staff
/statistics/schooling/resourcing
/statistics/schooling/board_of_trustees
/statistics/tertiary_education
/statistics/tertiary_education/transition-from-school-to-tertiary
/statistics/tertiary_education/participation
/statistics/tertiary_education/retention_and_achievement
/statistics/tertiary_education/research
/statistics/tertiary_education/resources
/statistics/tertiary_education/financial_performance
/statistics/tertiary_education/financial_support_for_students
/statistics/tertiary_education/life_after_study
/statistics/tertiary_education/summary_tables
/statistics/tertiary_education/university-rankings
/statistics/maori-education
/statistics/maori-education/maori-in-schooling
/statistics/maori-education/maori-in-schooling/6040
/statistics/maori-education/maori-in-schooling/participation-and-attainment-of-maori-students-in-national-certificate-of-educational-achievement
/statistics/maori-education/tertiary-education
/statistics/pasifika-education
/statistics/pasifika-education/progress_against_pasifika_education_plan_targets
/statistics/pasifika-education/pasifika-in-schooling
/statistics/pasifika-education/tertiary-education
/statistics/international-education
/statistics/international-education/international-students-in-new-zealand
/statistics/international-education/internationalisation-of-education-providers-in-nz2
/statistics/international-education/benefits-of-international-education-for-nz2
/statistics/international-education/students-international-learning2
/statistics/special-education
/statistics/special-education/ongoing-resourcing-scheme
/data-services
/data-services/collecting-information
/data-services/collecting-information/code-sets-and-classifications
/data-services/collecting-information/collection-forms
/data-services/collecting-information/guidelines
/data-services/collecting-information/school-enrolment-zones
/data-services/collecting-information/school-sms-roll-returns-2015
/data-services/collecting-information/sms_roll_returns
/data-services/data-collections
/data-services/data-collections/all
/data-services/data-collections/ece_staff_return
/data-services/data-collections/boards_of_trustees
/data-services/data-collections/ecesmc
/data-services/data-collections/iccs_data
/data-services/data-collections/integrated_student_loan_dataset
/data-services/data-collections/nemp
/data-services/data-collections/piaac
/data-services/data-collections/pirls
/data-services/data-collections/pisa
/data-services/data-collections/reading-recovery-electronic-returns
/data-services/data-collections/rtlit
/data-services/data-collections/school_leavers
/data-services/data-collections/school-roll-return
/data-services/data-collections/school-statistics-monitoring-committee
/data-services/data-collections/sdr
/data-services/data-collections/student_engagement
/data-services/data-collections/talis
/data-services/data-collections/teacher_census
/data-services/data-collections/tertiary_enrolment_data
/data-services/data-collections/timss
/data-services/data-collections/national
/data-services/data-collections/national/ece_staff_return
/data-services/data-collections/national/boards_of_trustees
/data-services/data-collections/national/ecesmc
/data-services/data-collections/national/integrated_student_loan_dataset
/data-services/data-collections/national/nemp
/data-services/data-collections/national/reading-recovery-electronic-returns
/data-services/data-collections/national/rtlit
/data-services/data-collections/national/school_leavers
/data-services/data-collections/national/school-roll-return
/data-services/data-collections/national/school-statistics-monitoring-committee
/data-services/data-collections/national/sdr
/data-services/data-collections/national/student_engagement
/data-services/data-collections/national/teacher_census
/data-services/data-collections/national/tertiary_enrolment_data
/data-services/data-collections/international
/data-services/data-collections/international/all
/data-services/data-collections/international/iccs_data
/data-services/data-collections/international/piaac
/data-services/data-collections/international/pirls
/data-services/data-collections/international/pisa
/data-services/data-collections/international/talis
/data-services/data-collections/international/timss
/data-services/directories
/data-services/directories/early-childhood-services
/data-services/directories/early-childhood-services/ministry-of-education-20-hours-ece
/data-services/directories/maori-medium-schools
/data-services/directories/maori-medium-schools/te-kete-ipurangi
/data-services/directories/list-of-nz-schools
/data-services/directories/private-schools
/data-services/directories/6136
/data-services/directories/6136/directories
/data-services/directories/list-of-tertiary-providers
/data-services/glossary
/site-info/site-map
/site-info/contact-us
/site-info/about-this-site
/site-info/accessibility
/site-info/privacy
/site-info/links



In [18]:
for urld in urldict:
    print urld
Senior-Student-Attainment
key_accordion
Student-Numbers
Research
School-SMS-Roll-Returns
What's-New
SOIK-(Student-Outcome-Information-Kits)
Education-Library
Te-Kete-Ipurangi
Statistics:-18-year-olds
School-Roll-Return
Pasifika-Tertiary-Education
Education-Counts-Logo
Code-Sets-&-Classifications
Resources
Financial-Support-for-Students
Ongoing-Resourcing-Scheme
About-BES
Early-Childhood-Education-Statistics-Monitoring-Committee
Contact-us
Investing-in-Educational-Success
Services
Developing-Mathematical-Inquiry-Communities
e-Learning
Life-after-Study
Site-map
V
D
e-Learning-Research-&-Evaluation
Educational-Directories
H
Directories
Summary-Tables
L
StudyLink:-Student-Loan
Public-Achievement-Information-(PAI)

Know-your-region
An-online-tool-where-you-can-find-education-data-for-different-regions-or-territorial-authority.-Using-this-tool-you-can-access-data-on-student-population,-student-engagement-and-student-achievement.

T
Single-Data-Return
BES-What-Works-Spotlights
Private-Schools
X
Students'-international-learning
Early-Learning-Services-Home-
Close-Menu
Latest-Publications
Links
Study-Awards-in-Māori-&-Pasifika-Education-Research-2015
Transition-from-School-to-Tertiary
BESs-&-BES-Cases
Annual-ECE-Census-Reports
Resourcing
Financial-Performance
Statistics:-ECE-Participation

Indicators
Education-Sector-Indicators-are-established-measures-used-to-determine-how-well-a-result-has-been-achieved-in-a-particular-area-of-interest.-For-example,-the-rate-of-formal-school-qualifications-helps-quantify-whether-students-are-succeeding-at-school.

School-Leavers
Collection-Forms
Internationalisation-of-students-in-NZ
Number-of-Schools
SDR-(Single-Data-Return)

Find-an-Early-Learning-Service
An-online-tool-where-you-can-search-for-a-particular-early-learning-service/centre-in-New-Zealand-and-find-its-profile,-including-contact-details.

Accessibility
Find-a-School-Home-
Māori
School-Statistics-Monitoring-Committee
International-Education
Board-of-Trustees
Early-Childhood-Education-Statistics-Monitoring-Committee-(ECESMC)

Statistics
Provides-you-access-to-statistical-information-about-education-and-education-services.

Inland-Revenue:-Student-Loans
Legal-&-Privacy
International-students
Indicators
International
Pasifika
Spotlight-on-Mathematics/Pāngarau
Staffing
Early-Childhood-Directory
RT:Lit
Data-Collections
Curriculum
PISA-(Programme-for-International-Student-Assessment)
Māori-medium-Education
Glossary
Publications-Home-
Māori-in-Schooling
Finances
Integrated-Student-Loan-Dataset
C
Tertiary-Enrolment-&-Completions-(TSEC)
ICCS
G
K
O
Indicators-Home-
S
Statistics:-School-Leavers
W
Annual-Early-Childhood-Education-Child-&-Staff-Return

Publications
Provides-you-access-to-research-publications-and-publications-with-a-data-or-quantitative-information-focus.

Data-Collections---National
PIRLS-(Progress-in-International-Reading-Literacy-Study)
Māori-Tertiary-Education
Q
Full-Set-of-BESs
Benefits-for-New-Zealand
School-Roll-Return-Forms
Topics
Guidelines
Data-Services
PISA
Scroll-to-top-of-page
Māori-Education
International-students-in-NZ
Statistics-NZ:-Student-Loans
U
Annual-ECE-Child-&-Staff-Return
Ngā-Whanaketanga-Rumaki-Māori
Pasifika-Education-Targets
Spotlight-on-Leadership
Retention-&-Achievement
Numeracy
Home
The-Use-of-Evidence-in-Policy
Statistics
Developing-Communities-of-Mathematical-Inquiry
Early-Learning-Services
Ongoing-Resourcing-Scheme-(ORS)
BES-Exemplars
Spotlight-on-Counter-Bullying-Pedagogies
Skip-to-content
Ministry-of-Education:-20-Hours-ECE
Collecting-Information
TIMSS-(Trends-in-International-Mathematics-&-Science-Study)
Early-Childhood-Education
National-Standards-&-Ngā-Whanaketanga-Rumaki-Māori

Topics
Topics-are-compilations-of-information-around-a-specific-theme.-Themes-may-combine-Education-Sector-Indicators,-research-and-evaluation,-and-statistical-information.

Know-your-Region-Home-
Tertiary-Education
Teacher-Census
Transition:-School-to-Tertiary
18-year-olds
B
Useful-links-&-publications
F
Special-Education
Student-Loans
J

Find-a-school
An-online-tool-where-you-can-search-for-a-particular-school-in-New-Zealand-and-find-its-profile,-including-contact-details.-You-can-also-access-student-population,-student-engagement-and-student-achievement-data-for-the-school.

N
New-Zealand-Schools
R
NEMP
Summaries-of-BESs
Z
BESs-&-cases
Annual-ECE-Census
ALL
RT:-Lit
TALIS-(Teaching-&-Learning-International-Survey)
BES-Programme
NEMP-
National-Standards
Directories-Homepage
National
Tertiary
Statistics-Home-
Know-your-Region
Ministry-of-Education:-Student-Loans
Ministry-of-Education:-PAI
University-Rankings
Skip-to-Secondary-Navigation-Menu
Teaching-Staff
Schooling
Māori-in-NCEA
International-Civic-&-Citizenship-Education-Study-(ICCS)
English-medium-Education
Directories-(includes-Schools-Directory)
Data-Collections---International
Skip-to-Primary-Navigation-Menu
Student-Engagement
ALL-(Adult-Literacy-&-Life-Skills-Survey)
School-Enrolment-Zones
NCEA-Attainment
Tertiary-Providers
Boards-of-Trustees
Data-Services-Home-
Programme-for-the-International-Assessment-of-Adult-Competencies-(PIAAC)
Pasifika-in-Schooling
Pasifika-Education
Tertiary-Enrolment-&-Completions
Benefits-of-international-education-for-NZ
About-this-site
BES-(What-Works-Evidence)
TIMSS
PIAAC
Reading-Recovery-Electronic-Returns
Literacy
A
E
Māori-medium-&-English-medium
School-SMS-Roll-Returns-2015
I
M
Deaker/Berryman-Interview
Language-use-in-ECE
The-Research-Division---Wahanga-Mahi-Rangahau
English-Medium:-Student-Achievement-in-NZ-Information-Kit
Publications
Topics-Home-
Y

Data-Services
Provides-information-to-assist-you-to-understand-and-use-other-information-provided-on-the-website.-Information-includes,-a-glossary,-data-dictionaries,-descriptions-of-data-sources,-etc.

Internationalisation
Find-a-School
SMS-Vendors
Māori-Medium-Schools
PIRLS
School-Mergers
P
Series
Research-Record
National-Monitoring-Study-of-Student-Achievement-(NMSSA)
Skip-to-search
Participation
TALIS
Māori-Language
In [19]:
fixdict = dict()
In [19]:
 
In [20]:
edulen = len(edu)
In [21]:
edulen
Out[21]:
342
In [22]:
#urldict.update({edu.text.replace(' ', '-') :  edu.attrs['href']})
In [23]:
opeducount = open('/home/wcmckee/educount/educationcounts-url.json', 'r')

opcondz = opeducount.read()
In [24]:
diccon = json.loads(opcondz)
In [25]:
diccon
Out[25]:
{u'': u'http://www.newzealand.govt.nz',
 u'\ndata-servic': u'https://www.educationcounts.govt.nz/data-services',
 u'\nfind-a-scho': u'https://www.educationcounts.govt.nz/find-school',
 u'\nfind-an-ear': u'https://www.educationcounts.govt.nz/find-an-els',
 u'\nindicators\n': u'https://www.educationcounts.govt.nz/indicators',
 u'\nknow-your-r': u'https://www.educationcounts.govt.nz/know-your-region',
 u'\npublication': u'https://www.educationcounts.govt.nz/publications',
 u'\nstatistics\n': u'https://www.educationcounts.govt.nz/statistics',
 u'\ntopics\ntopi': u'https://www.educationcounts.govt.nz/topics',
 u'18-year-olds': u'https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment/18-year-olds-with-level-2-or-equivalent',
 u'a': u'https://www.educationcounts.govt.nz/data-services/glossary#A',
 u'about-bes': u'https://www.educationcounts.govt.nz/topics/bes/about-bes',
 u'about-this-s': u'/site-info/about-this-site',
 u'accessibilit': u'/site-info/accessibility',
 u'all': u'/data-services/data-collections/all',
 u'all-(adult-l': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/all',
 u'annual-early': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/ece_staff_return',
 u'annual-ece-c': u'https://www.educationcounts.govt.nz/statistics/early-childhood-education/annual-ece-summary-reports',
 u'b': u'https://www.educationcounts.govt.nz/data-services/glossary#B',
 u'benefits-for': u'https://www.educationcounts.govt.nz/statistics/international-education/benefits-of-international-education-for-nz2',
 u'benefits-of-': u'https://www.educationcounts.govt.nz/statistics/international-education/benefits-of-international-education-for-nz2',
 u'bes-(what-wo': u'/topics/bes',
 u'bes-exemplar': u'https://www.educationcounts.govt.nz/topics/bes/useful-links-and-publications/bes-exemplars',
 u'bes-programm': u'https://www.educationcounts.govt.nz/topics/bes',
 u'bes-what-wor': u'https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on',
 u'bess-&-bes-c': u'https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases',
 u'bess-&-cases': u'https://www.educationcounts.govt.nz/topics/bes/resources/bes-exemplars/bess-and-cases',
 u'board-of-tru': u'https://www.educationcounts.govt.nz/data-services/data-collections/boards_of_trustees',
 u'boards-of-tr': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/boards_of_trustees',
 u'c': u'https://www.educationcounts.govt.nz/data-services/glossary#C',
 u'close-menu': u'#secondary-nav',
 u'code-sets-&-': u'https://www.educationcounts.govt.nz/data-services/collecting-information/code-sets-and-classifications',
 u'collecting-i': u'https://www.educationcounts.govt.nz/data-services/collecting-information',
 u'collection-f': u'https://www.educationcounts.govt.nz/data-services/collecting-information/collection-forms',
 u'contact-us': u'/site-info/contact-us',
 u'curriculum': u'https://www.educationcounts.govt.nz/publications/curriculum',
 u'd': u'https://www.educationcounts.govt.nz/data-services/glossary#D',
 u'data-collect': u'https://www.educationcounts.govt.nz/data-services/data-collections',
 u'data-service': u'https://www.educationcounts.govt.nz/data-services',
 u'deaker/berry': u'https://www.educationcounts.govt.nz/topics/bes/Whats-New/deakerberryman-interview',
 u'developing-c': u'https://www.educationcounts.govt.nz/topics/bes/Whats-New/developing-communities-of-mathematical-inquiry',
 u'developing-m': u'https://www.educationcounts.govt.nz/topics/bes/developing-mathematical-inquiry-communities',
 u'directories': u'https://www.educationcounts.govt.nz/data-services/directories',
 u'directories-': u'https://www.educationcounts.govt.nz/data-services/directories/6136/directories',
 u'e': u'https://www.educationcounts.govt.nz/data-services/glossary#E',
 u'e-learning': u'https://www.educationcounts.govt.nz/publications/ict',
 u'e-learning-r': u'https://www.educationcounts.govt.nz/topics/ict_themes',
 u'early-childh': u'https://www.educationcounts.govt.nz/data-services/directories/early-childhood-services',
 u'early-learni': u'https://www.educationcounts.govt.nz/find-an-els',
 u'education-co': u'/',
 u'education-li': u'https://www.educationcounts.govt.nz/topics/ministry-of-education-library/education-library',
 u'educational-': u'https://www.educationcounts.govt.nz/data-services/directories',
 u'english-medi': u'https://www.educationcounts.govt.nz/publications/maori/english-medium-education',
 u'f': u'https://www.educationcounts.govt.nz/data-services/glossary#F',
 u'finances': u'https://www.educationcounts.govt.nz/statistics/early-childhood-education/finances',
 u'financial-pe': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/financial_performance',
 u'financial-su': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/financial_support_for_students',
 u'find-a-schoo': u'https://www.educationcounts.govt.nz/find-school',
 u'full-set-of-': u'https://www.educationcounts.govt.nz/topics/bes/resources/bes-programme/full-set-of-bess',
 u'g': u'https://www.educationcounts.govt.nz/data-services/glossary#G',
 u'glossary': u'https://www.educationcounts.govt.nz/data-services/glossary',
 u'guidelines': u'https://www.educationcounts.govt.nz/data-services/collecting-information/guidelines',
 u'h': u'https://www.educationcounts.govt.nz/data-services/glossary#H',
 u'home': u'/',
 u'i': u'https://www.educationcounts.govt.nz/data-services/glossary#I',
 u'iccs': u'/data-services/data-collections/iccs_data',
 u'indicators': u'https://www.educationcounts.govt.nz/indicators',
 u'indicators-h': u'https://www.educationcounts.govt.nz/indicators',
 u'inland-reven': u'https://www.educationcounts.govt.nz/topics/26298/inland-revenue-website',
 u'integrated-s': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/integrated_student_loan_dataset',
 u'internationa': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/iccs_data',
 u'investing-in': u'http://www.minedu.govt.nz/theMinistry/EducationInitiatives/InvestingInEducationalSuccess.aspx',
 u'j': u'https://www.educationcounts.govt.nz/data-services/glossary#J',
 u'k': u'https://www.educationcounts.govt.nz/data-services/glossary#K',
 u'key_accordio': u'https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases/key_accordion',
 u'know-your-re': u'https://www.educationcounts.govt.nz/know-your-region',
 u'l': u'https://www.educationcounts.govt.nz/data-services/glossary#L',
 u'language-use': u'https://www.educationcounts.govt.nz/statistics/early-childhood-education/language-use-in-ece',
 u'latest-publi': u'http://www.educationcounts.govt.nz/publications?SQ_PAINT_LAYOUT_NAME=all-chronological',
 u'legal-&-priv': u'/site-info/privacy',
 u'life-after-s': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/life_after_study',
 u'links': u'/site-info/links',
 u'literacy': u'https://www.educationcounts.govt.nz/publications/literacy',
 u'm': u'https://www.educationcounts.govt.nz/data-services/glossary#M',
 u'ministry-of-': u'https://www.educationcounts.govt.nz/data-services/directories/early-childhood-services/ministry-of-education-20-hours-ece',
 u'm\u0101ori': u'https://www.educationcounts.govt.nz/publications/maori',
 u'm\u0101ori-educat': u'https://www.educationcounts.govt.nz/statistics/maori-education',
 u'm\u0101ori-in-nce': u'https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling/participation-and-attainment-of-maori-students-in-national-certificate-of-educational-achievement',
 u'm\u0101ori-in-sch': u'https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling',
 u'm\u0101ori-langua': u'https://www.educationcounts.govt.nz/statistics/maori-education/maori-in-schooling/6040',
 u'm\u0101ori-medium': u'https://www.educationcounts.govt.nz/data-services/directories/maori-medium-schools',
 u'm\u0101ori-tertia': u'https://www.educationcounts.govt.nz/statistics/maori-education/tertiary-education',
 u'n': u'https://www.educationcounts.govt.nz/data-services/glossary#N',
 u'national': u'https://www.educationcounts.govt.nz/data-services/data-collections/national',
 u'national-mon': u'https://www.educationcounts.govt.nz/topics/research/nmssa',
 u'national-sta': u'https://www.educationcounts.govt.nz/statistics/schooling/national-standards',
 u'ncea-attainm': u'https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment/ncea-attainment',
 u'nemp': u'/data-services/data-collections/nemp',
 u'nemp-': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/nemp',
 u'new-zealand-': u'https://www.educationcounts.govt.nz/data-services/directories/list-of-nz-schools',
 u'ng\u0101-whanaket': u'https://www.educationcounts.govt.nz/statistics/schooling/nga-whanaketanga-rumaki-maori-achievement-results',
 u'number-of-sc': u'https://www.educationcounts.govt.nz/statistics/schooling/number-of-schools',
 u'numeracy': u'https://www.educationcounts.govt.nz/publications/numeracy',
 u'o': u'https://www.educationcounts.govt.nz/data-services/glossary#O',
 u'ongoing-reso': u'https://www.educationcounts.govt.nz/statistics/special-education/ongoing-resourcing-scheme',
 u'p': u'https://www.educationcounts.govt.nz/data-services/glossary#P',
 u'participatio': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/participation',
 u'pasifika': u'https://www.educationcounts.govt.nz/publications/pasifika',
 u'pasifika-edu': u'https://www.educationcounts.govt.nz/statistics/pasifika-education/progress_against_pasifika_education_plan_targets',
 u'pasifika-in-': u'https://www.educationcounts.govt.nz/statistics/pasifika-education/pasifika-in-schooling',
 u'pasifika-ter': u'https://www.educationcounts.govt.nz/statistics/pasifika-education/tertiary-education',
 u'piaac': u'/data-services/data-collections/piaac',
 u'pirls': u'/data-services/data-collections/pirls',
 u'pirls-(progr': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/pirls',
 u'pisa': u'/data-services/data-collections/pisa',
 u'pisa-(progra': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/pisa',
 u'private-scho': u'https://www.educationcounts.govt.nz/data-services/directories/private-schools',
 u'programme-fo': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/piaac',
 u'public-achie': u'https://www.educationcounts.govt.nz/topics/national-education',
 u'publications': u'https://www.educationcounts.govt.nz/publications',
 u'q': u'https://www.educationcounts.govt.nz/data-services/glossary#Q',
 u'r': u'https://www.educationcounts.govt.nz/data-services/glossary#R',
 u'reading-reco': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/reading-recovery-electronic-returns',
 u'research': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/research',
 u'research-rec': u'https://www.educationcounts.govt.nz/topics/research/52109',
 u'resources': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/resources',
 u'resourcing': u'https://www.educationcounts.govt.nz/statistics/schooling/resourcing',
 u'retention-&-': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/retention_and_achievement',
 u'rt:-lit': u'https://www.educationcounts.govt.nz/data-services/data-collections/rtlit',
 u'rt:lit': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/rtlit',
 u's': u'https://www.educationcounts.govt.nz/data-services/glossary#S',
 u'school-enrol': u'https://www.educationcounts.govt.nz/data-services/collecting-information/school-enrolment-zones',
 u'school-leave': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/school_leavers',
 u'school-merge': u'https://www.educationcounts.govt.nz/data-services/directories/6136',
 u'school-roll-': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/school-roll-return',
 u'school-sms-r': u'https://www.educationcounts.govt.nz/data-services/collecting-information/school-sms-roll-returns-2015',
 u'school-stati': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/school-statistics-monitoring-committee',
 u'schooling': u'https://www.educationcounts.govt.nz/statistics/schooling',
 u'scroll-to-to': u'#masthead',
 u'sdr-(single-': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/sdr',
 u'senior-stude': u'https://www.educationcounts.govt.nz/statistics/schooling/senior-student-attainment',
 u'series': u'https://www.educationcounts.govt.nz/publications/series',
 u'services': u'https://www.educationcounts.govt.nz/statistics/early-childhood-education/services',
 u'single-data-': u'https://www.educationcounts.govt.nz/data-services/data-collections/sdr',
 u'site-map': u'/site-info/site-map',
 u'skip-to-cont': u'#content',
 u'skip-to-prim': u'#primary-nav',
 u'skip-to-sear': u'#site-search-keyword',
 u'skip-to-seco': u'#secondary-nav',
 u'sms-vendors': u'https://www.educationcounts.govt.nz/data-services/collecting-information/sms_roll_returns',
 u'soik-(studen': u'https://www.educationcounts.govt.nz/topics/research/6858',
 u'special-educ': u'https://www.educationcounts.govt.nz/statistics/special-education',
 u'spotlight-on': u'https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on/spotlight-on-leadership',
 u'staffing': u'https://www.educationcounts.govt.nz/statistics/early-childhood-education/staffing',
 u'statistics': u'https://www.educationcounts.govt.nz/statistics',
 u'statistics-h': u'https://www.educationcounts.govt.nz/statistics',
 u'statistics-n': u'https://www.educationcounts.govt.nz/topics/26298/statistics-nz-student-loans',
 u'statistics:-': u'https://www.educationcounts.govt.nz/topics/national-education/school-leavers-with-ncea-level-2-or-above',
 u'student-enga': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/student_engagement',
 u'student-loan': u'https://www.educationcounts.govt.nz/topics/26298',
 u'student-numb': u'https://www.educationcounts.govt.nz/statistics/schooling/student-numbers',
 u"students'-in": u'https://www.educationcounts.govt.nz/statistics/international-education/students-international-learning2',
 u'study-awards': u'https://www.educationcounts.govt.nz/topics/research/16721',
 u'studylink:-s': u'https://www.educationcounts.govt.nz/topics/26298/studylink-website',
 u'summaries-of': u'https://www.educationcounts.govt.nz/topics/bes/resources/bes-programme',
 u'summary-tabl': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/summary_tables',
 u't': u'https://www.educationcounts.govt.nz/data-services/glossary#T',
 u'talis': u'/data-services/data-collections/talis',
 u'talis-(teach': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/talis',
 u'te-kete-ipur': u'https://www.educationcounts.govt.nz/data-services/directories/maori-medium-schools/te-kete-ipurangi',
 u'teacher-cens': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/teacher_census',
 u'teaching-sta': u'https://www.educationcounts.govt.nz/statistics/schooling/teaching_staff',
 u'tertiary': u'https://www.educationcounts.govt.nz/publications/80898',
 u'tertiary-edu': u'https://www.educationcounts.govt.nz/statistics/tertiary_education',
 u'tertiary-enr': u'https://www.educationcounts.govt.nz/data-services/data-collections/national/tertiary_enrolment_data',
 u'tertiary-pro': u'https://www.educationcounts.govt.nz/data-services/directories/list-of-tertiary-providers',
 u'the-research': u'https://www.educationcounts.govt.nz/topics/research/research_division',
 u'the-use-of-e': u'https://www.educationcounts.govt.nz/topics/bes/resources/spotlight-on/the-use-of-evidence-in-policy',
 u'timss': u'/data-services/data-collections/timss',
 u'timss-(trend': u'https://www.educationcounts.govt.nz/data-services/data-collections/international/timss',
 u'topics': u'https://www.educationcounts.govt.nz/topics',
 u'topics-home-': u'https://www.educationcounts.govt.nz/topics',
 u'transition-f': u'https://www.educationcounts.govt.nz/statistics/tertiary-education/transition-from-school-to-tertiary',
 u'transition:-': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/transition-from-school-to-tertiary',
 u'u': u'https://www.educationcounts.govt.nz/data-services/glossary#U',
 u'university-r': u'https://www.educationcounts.govt.nz/statistics/tertiary_education/university-rankings',
 u'useful-links': u'https://www.educationcounts.govt.nz/topics/bes/useful-links-and-publications',
 u'v': u'https://www.educationcounts.govt.nz/data-services/glossary#V',
 u'w': u'https://www.educationcounts.govt.nz/data-services/glossary#W',
 u"what's-new": u'https://www.educationcounts.govt.nz/topics/bes/resources/bess-and-cases/whats-new',
 u'x': u'https://www.educationcounts.govt.nz/data-services/glossary#X',
 u'y': u'https://www.educationcounts.govt.nz/data-services/glossary#Y',
 u'z': u'https://www.educationcounts.govt.nz/data-services/glossary#Z'}
In [26]:
if 'P' in 'Python':
    print 'YES'
else:
    print 'NO'
YES
In [27]:
for ed in edu:
    #print ed
    #print ed.attrs['href']
    if 'https://' in ed.attrs['href']:
        #print ed.attrs['href']
        #print 'no'
        requrlz = requests.get(ed.attrs['href'])
        edcountz = bs4.BeautifulSoup(requrlz.text)
        #edftxt = edcountz.text
        #edftxt.
        edfa = edcountz.findAll('a')
        edur = edcountz.
        print edfa
        #for edfq in edfa:
        #    if '.xls' in edfq.attrs['href']:
        #        print ed
    
  File "<ipython-input-27-487eaf1b5c9c>", line 12
    edur = edcountz.
                    ^
SyntaxError: invalid syntax
In [27]:
 
In [28]:
doc = dominate.document(title='EducationCounts')

with doc.head:
    link(rel='stylesheet', href='style.css')
    script(type ='text/javascript', src='script.js')
    #str(str2)
    
    with div():
        attr(cls='header')
        h1('EducationCounts')
        p(img('imgs/getsdrawn-bw.png', src='imgs/getsdrawn-bw.png'))
        #p(img('imgs/15/01/02/ReptileLover82-reference.png', src= 'imgs/15/01/02/ReptileLover82-reference.png'))
        #h1('Updated ', strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
        #p(panz)
        #p(bodycom)
    
    

with doc:
    with div(id='body').add(ol()):
        #for tagz in tagliz:
        #    for ta in tagz:
        #        p(ta)
        for ed in edu:
            #print ed.text.replace(' ', '-')
            #print ed.attrs['href']
            #print ed.text[:22]
            gied = ed.text
            gifz = gied.replace(' ', '-')
            giflow = gifz.lower()
            gidict.update({giflow[:12] : ed.attrs['href']})
            o = urlparse(ed.attrs['href'])
            
            requrlz = requests.get(ed.attrs['href'])
            edcountz = bs4.BeautifulSoup(requrlz.title)
            #edlinkhr = edcountz.attrs['href']
            p(a((giflow[:12]), href= ed.attrs['href']))
            p((ecountz))

            
            
            #change this path so that each element of the 
            #path can be used as TAGS
            #
            #print o.path
            #tapen = (o.path.replace('/', ', ')[1:])
            tapen = (o.path[1:])
            #gidict.update({ed.attrs['href'] : o.path[1:]})
            #print [tagz.strip() for tagz in tagz.split(',')]
            tagliz.append([tapen.strip() for tapen in tapen.split(',')])

    
    
                
            #print rdz.url
            #if '.jpg' in rdz.url:
            #    img(rdz.urlz)
            #else:
            #    a(rdz.urlz)
            #h1(str(rdz.author))
            
            #li(img(i.lower(), src='%s' % i))

    with div():
        attr(cls='body')
        p('EducationCounts-url is open source')
        a('https://github.com/getsdrawn/getsdrawndotcom')
        a('https://reddit.com/r/redditgetsdrawn')

#print doc
---------------------------------------------------------------------------
MissingSchema                             Traceback (most recent call last)
<ipython-input-28-2b6d71455596> in <module>()
     32             o = urlparse(ed.attrs['href'])
     33 
---> 34             requrlz = requests.get(ed.attrs['href'])
     35             edcountz = bs4.BeautifulSoup(requrlz.title)
     36             #edlinkhr = edcountz.attrs['href']

/usr/local/lib/python2.7/dist-packages/requests/api.pyc in get(url, **kwargs)
     63 
     64     kwargs.setdefault('allow_redirects', True)
---> 65     return request('get', url, **kwargs)
     66 
     67 

/usr/local/lib/python2.7/dist-packages/requests/api.pyc in request(method, url, **kwargs)
     47 
     48     session = sessions.Session()
---> 49     response = session.request(method=method, url=url, **kwargs)
     50     # By explicitly closing the session, we avoid leaving sockets open which
     51     # can trigger a ResourceWarning in some cases, and look like a memory leak

/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    445             hooks = hooks,
    446         )
--> 447         prep = self.prepare_request(req)
    448 
    449         proxies = proxies or {}

/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in prepare_request(self, request)
    376             auth=merge_setting(auth, self.auth),
    377             cookies=merged_cookies,
--> 378             hooks=merge_hooks(request.hooks, self.hooks),
    379         )
    380         return p

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in prepare(self, method, url, headers, files, data, params, auth, cookies, hooks, json)
    301 
    302         self.prepare_method(method)
--> 303         self.prepare_url(url, params)
    304         self.prepare_headers(headers)
    305         self.prepare_cookies(cookies)

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in prepare_url(self, url, params)
    358         if not scheme:
    359             raise MissingSchema("Invalid URL {0!r}: No schema supplied. "
--> 360                                 "Perhaps you meant http://{0}?".format(url))
    361 
    362         if not host:

MissingSchema: Invalid URL u'/': No schema supplied. Perhaps you meant http:///?
In [29]:
docre = doc.render()
#s = docre.decode('ascii', 'ignore')
yourstring = docre.encode('ascii', 'ignore').decode('ascii')
indfil = ('/home/wcmckee/educount/index.html')
mkind = open(indfil, 'w')
mkind.write(yourstring)
mkind.close()
In [ ]:
 

Comments

Comments powered by Disqus