0

I am scraping data from a proprietary system that serves inventory information via HTML. It includes images of parts that I'd like to scrape, but I cannot use the src link directly (the system is designed to block requests that aren't part of a returned web search). Since I am already scraping the HTML/page text, I'm hoping that someone can tell me how images are stored in IE once a page is loaded, and if there is any way to access that using the MS HTML reference commands/library

I've tried pinging the server directly with various versions of the src URL, with no luck.

Here are some relevant lines of my VBA:

Dim IE As InternetExplorer

Set IE = objShell.Windows(x)

Dim html As Object

Set html = IE.document

Dim ResultClasses as Object

Set resultClasses = html.getElementsByClassName("PM Parts List")

My goal is to add the appropriate IE/HTML call to get the images that were loaded when the page was originally loaded in IE. I cannot call the page to load it from the start within Excel VBA, due to the way items are selected (the load of building out a whole interface within Excel and using sendkeys would be way more hassle than getting the pictures to add to the procurement form for use when validating order reciept

fabla
  • 1,806
  • 1
  • 8
  • 20
K ATL
  • 39
  • 5
  • @QHarr as I understand from OP question, he needs somehow to extract the loaded (or may be cached) images (i. e. images content) directly from DOM, but not src links. – omegastripes Jul 26 '19 at 23:21
  • @omegastripes I admit to being confused. – QHarr Jul 26 '19 at 23:21
  • Try to implement the approach with canvas from [this answer](https://stackoverflow.com/a/934925/2165759). – omegastripes Jul 26 '19 at 23:28
  • Please check your code how do you display the image in your web site?Generally, the IE browser using cache to store the images, if you are suing src and image link method to display the image, I think it is hard to get the image data from the web site in your scenario. So, I suggest you could try to modify your web site and try to use a base64 string to display an image, then refer to [this thread](https://stackoverflow.com/questions/39126617/inserting-an-image-into-a-sheet-using-base64-in-vba) to insert image into excel using base64 string in VBA – Zhi Lv Jul 29 '19 at 06:40

0 Answers0