def _download_content(url, request, path_to_figures): 
    website = url
    url = request
    try:
        page = download_as_text(url)
        # we will look for images and other files embedded in the html
        re_imgs = re.compile('<img[^>]*/>')
        re_src = re.compile('(.*src=")([^"]*)"')
        re_a = re.compile('<a[^>]*>[^<]*</a>')
        re_href = re.compile('(.*href=")([^"]*)"')
        images = re_imgs.findall(page)
        files = re_a.findall(page)
        failed = False
        msg = ''
        if len(images) > 0 or len(files) > 0:
            for i in images:
                pngfile = re_src.match(i).groups()[1]
                if not check_url(pngfile):
                    img = website + pngfile
                else:
                    img = pngfile
                    
                if not download(img, os.path.join(path_to_figures,
                                                  os.path.basename(img))):
                    msg += "Error when downloading image: %s. <return>" %img
                    failed = True
                        
            for f in files:
                otherfile = re_href.match(f).groups()[1]
                    
                if not check_url(otherfile):
                    filename = website + otherfile
                else:
                    filename = otherfile
                    
                if not download(filename, os.path.join(path_to_figures,
                                os.path.basename(filename))):
                    msg += "Error when downloading file: %s. <return>"%filename
                    failed = True
                        
            if not failed :
                return (True, "")
            else:
                return (False, msg)
        else:
            msg = "url: '%s' \n returned: %s" % (url,page.strip())
            return (False, msg)
            
    except Exception, e:
        return (False, str(e))
Get a s3 handle for s3 operation.
dataset/ETHPy150Open VisTrails/VisTrails/extensions/latex/includevistrail.py/_download_content--crossover with--dataset/ETHPy150Open bloomreach/briefly/src/briefly/fs.py/S3FileSystem.get_s3handle