I usually write function-only Python programs, but have decided on an OOP approach (my first thereof) for my current program, a web-scraper. Here is the working code I wrote which I am looking to have critiqued:import csvimport urllib2NO_VACANCIES = ['no vacancies', 'not hiring']class Page(object):    def __init__(self, url):        self.url = url    def get_source(self):        self.source = urllib2.urlopen(url).read()        return self.source  class HubPage(Page):    def has_vacancies(self):        return not(any(text for text in NO_VACANCIES if text in self.source.lower()))urls = []with open('25.csv', 'rb') as spreadsheet:    reader = csv.reader(spreadsheet)    for row in reader:        urls.append(row[0].strip())for url in urls:    page = HubPage(url)    source = page.get_source()    if page.has_vacancies():        print 'Has vacancies'Some context: HubPage represents a typical 'jobs' page on a company's web site. I am subclassing Page because I well eventually subclass it again for individual job pages, and some methods that will be used only to extract data for individual job pages.Here's my issue: I know from experience that urllib2, while it has its critics, is fast - very fast - at doing what it does, namely fetch a page's source. Yet I notice that in my design, processing of each url is taking a few orders of magnitude longer than what I typically observe.Is it the fact that class instantiations are involved (unnecessarily,perhaps)? Might the fact that HubPage is inherited be at cause? Is the call to any() expensive?
Object-oriented web scraping with Python
python;object oriented;functional programming;inheritance;iteration