'Gets the tags from an image and likes 50 images for each tag'

def like_from_image(self, url, amount=50, media=None):

    if self.aborting:
        return self
    try:
        if (not url):
            urls = self.browser.find_elements_by_xpath('//main//article//div//div[1]//div[1]//a[1]')
            url = urls[0].get_attribute('href')
            print ('new    url    ', url)
        tags = get_tags(self.browser, url)
        print tags
        self.like_by_tags(tags, amount, media)
    except TypeError as err:
        print 'Sorry,    an    error    occured:    {}'.format(err)
        self.logFile.write('Sorry,    an    error    occured:    {}\n'.format(err))
        self.aborting = True
        return self
    return self
