How can I get a specific element of a determined webpage to display it in excel WebBrowser as example like <img>
or <iframe>
or <audio>
or <a>
... etc.
I know how to display an image if it is not a part of webpage like the following.
WebBrowser1.Navigate "about:blank"
WebBrowser1.Document.Write "<img style=""width:100%;"" src=""http://www.sthua.edu.sg/images/vba-logo.jpg"">"
but I don't know how to get an element by id or class name from any webpage.
Here is an example showing how to retrieve
class="gt-baf-table"
element from the webpage translate.google.com.eg, and put it intoWebBrowser1
control on theUserForm1
:The resulting output on the
UserForm1
is as follows:And the same fragment rendered in Chrome: