'Finds the index of the tag containing the text'

def find_index(self, soup, text):

    for i in range(0, len(soup)):
        img = soup[i].find(u'img')
        if ((soup[i].text.strip() == u'') and img and (text.lower() in img.get(u'title').lower())):
            return i
        elif (text.lower() in soup[i].text.lower()):
            return i
    raise plugin.PluginError(u'AlphaRatio    layout    has    changed,    unable    to    parse    correctly.    Please    open    a    Github    issue')
