#this is to extract the state code '##'
        state = cityStateText[-2:]
        return state

    def getBikeName(self, soup):
        bikeNameDiv = soup.find_all("div", class_='grid_8 margin-top10')
        bikeName = self.getStringFromSoupElement(bikeNameDiv[0].h1)
        bikeName = bikeName.replace('Used, ', '')
        return bikeName

    def unicodeToString(self, unicode):
        if unicode is None:
            return unicode
        else:
            return unicode.encode('ascii','ignore')

    def getStringFromSoupElement(self, element):
        str = self.unicodeToString(element.get_text())
        if str is not None:
            str = " ".join(str.split())
        return str

if __name__ == '__main__':
    instance = Extractor()
    daoInstance = Dao()
    readerHelper = Helper()
    for fileName in readerHelper.getAllHtmlFileNames():
        dict = instance.extract(fileName)
        if bool(dict):
            daoInstance.populateAndExecute(dict)