Image extraction from webpage
10 次查看(过去 30 天)
显示 更早的评论
There are serial-numbered webpages (some of these numbers don't exist), which have images of interest at one particular location in the html file:
<h4 id="COMPANY">COMPANY</h4>
<p><img class="image" border="0" src="/resources/companyName_company.jpg"/></p>
The companyName is different in each numbered webpage.
However, urlwrite gives only html pages without these images. When opened in browser, these images are absent. Since it is these images that are of interest, and none of the other content of the webpage, the whole purpose is defeated. How can this be resolved ? Is there a way to get only these images, and nothing else from the webpage ?
采纳的回答
Rik
2020-4-27
The HTML file doesn't contain the image. It contains a relative path to the image. Because you don't have the image file in the location the HTML file specifies the image doesn't show up. You need to use the 3 step process below to get the image file.
- download the HTML file
- determine '/resources/companyName_company.jpg'
- dowload the image from website.com/resources/companyName_company.jpg
18 个评论
Rik
2020-4-29
Glad to be of help.
Since you suggested to be bound by an NDA not to provide more details I don't see what adding "(subject to testing)" is trying to accomplish. Obviously it works on a recent release of Matlab for this example, otherwise I wouldn't have posted it. The only thing it currently accomplishes is sounding condescending.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!