donglei2022 2014-09-30 06:58
浏览 7

如何从HTML doc获取img

let's say taht I have a html code on a variable with only one img on it. And i want to save the img on variable and later on use it with Tesseract. How i am getting this img? ( this is the only img on the doc for sure)

Thanks!

  • 写回答

1条回答 默认 最新

  • dtrpv60860 2014-09-30 07:01
    关注

    This would get you the source-uri for the first <img> tag on the document.

    alert(document.getElementsByTagName('img')[0].src);
    <img src="some_image.png" />

    </div>
    
    评论

报告相同问题?