<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Web Browser ActiveX question in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45465#M28811</link>
    <description>Denis,&lt;BR /&gt;&lt;BR /&gt;I am not exactly clear on precisely what you are trying to save, but I can offer this:&lt;BR /&gt;&lt;BR /&gt;If you are only trying to save images, such as .jpg, .gif, etc, then there is a MUCH easier way to do this than trying to do what you are doing.&lt;BR /&gt;&lt;BR /&gt;If you are trying to save an image of the webpage displayed, then this can also be more easily accomplished.&lt;BR /&gt;&lt;BR /&gt;The problem I see is that you are making the common mistake of assuming that the browser is an actual reflection of the content of a webpage.  This is not the case.  A browser interprets HTML and other code, and displays what the code tells the browser to display.  This includes images.&lt;BR /&gt;&lt;BR /&gt;I will describe how to grab images from a webpage, and let you figure out how to save the entire page on your own.&lt;BR /&gt;  Actually, once you learn to do what I describe, you will have all you need in order to save the entire page.&lt;BR /&gt;&lt;BR /&gt;First, you want to grab the content.  I use "Datasocket Read" to obtain the content (just input the complete URL, and a string constant to the "type" input, and it gives you back the content.)  You then just parse out the text.  I just simply use "Match String" and pull the data between "src="" and """ (note, that means src=" and " are the exact strings searched for.)  This gives you the URL of the images.  Then, you can input a .jpg or .gif to the Datasocket Read and grab and save teh image.&lt;BR /&gt;&lt;BR /&gt;I hope this answers your questions.  If not, email me. &lt;BR /&gt;</description>
    <pubDate>Sat, 11 May 2002 16:06:26 GMT</pubDate>
    <dc:creator>Labviewguru</dc:creator>
    <dc:date>2002-05-11T16:06:26Z</dc:date>
    <item>
      <title>Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45464#M28810</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm using MS' web browser control to view info off the web.  What I'd like&lt;BR /&gt;to accomplish is programmatic saving of images that are currently being&lt;BR /&gt;displayed.&lt;BR /&gt;&lt;BR /&gt;Unfortunately I can't seem to get this done.  I've included two methods that&lt;BR /&gt;I've been trying.  Has anyone accomplished this?&lt;BR /&gt;&lt;BR /&gt;Method 1 gets a reference to the image in the control.  I can retrieve&lt;BR /&gt;various properties from the image, but I can seem to find the actual data.&lt;BR /&gt;I think the data can be retrieved using the 'toString' method, but I haven't&lt;BR /&gt;been able to figure out how...&lt;BR /&gt;&lt;BR /&gt;Method 2 uses the ExecWB method with the 'SaveAs' command on the control.&lt;BR /&gt;Works great, but the problem is that I can seem to disable the file dialog.&lt;BR /&gt;&lt;BR /&gt;If anyone can help me out, I'd a&lt;BR /&gt;pprciate it.&lt;BR /&gt;&lt;BR /&gt;Denis.&lt;BR /&gt;&lt;BR /&gt;P.S.  I've found some help for the methods/properties here:&lt;BR /&gt;http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrows&lt;BR /&gt;er/webbrowser.asp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Attachment Method 1.vi, see below]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Attachment Method 2.vi, see below]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Attachment MID7604 14.jpg, see below] &lt;BR /&gt;</description>
      <pubDate>Tue, 02 Apr 2002 16:07:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45464#M28810</guid>
      <dc:creator>DJ_001</dc:creator>
      <dc:date>2002-04-02T16:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45465#M28811</link>
      <description>Denis,&lt;BR /&gt;&lt;BR /&gt;I am not exactly clear on precisely what you are trying to save, but I can offer this:&lt;BR /&gt;&lt;BR /&gt;If you are only trying to save images, such as .jpg, .gif, etc, then there is a MUCH easier way to do this than trying to do what you are doing.&lt;BR /&gt;&lt;BR /&gt;If you are trying to save an image of the webpage displayed, then this can also be more easily accomplished.&lt;BR /&gt;&lt;BR /&gt;The problem I see is that you are making the common mistake of assuming that the browser is an actual reflection of the content of a webpage.  This is not the case.  A browser interprets HTML and other code, and displays what the code tells the browser to display.  This includes images.&lt;BR /&gt;&lt;BR /&gt;I will describe how to grab images from a webpage, and let you figure out how to save the entire page on your own.&lt;BR /&gt;  Actually, once you learn to do what I describe, you will have all you need in order to save the entire page.&lt;BR /&gt;&lt;BR /&gt;First, you want to grab the content.  I use "Datasocket Read" to obtain the content (just input the complete URL, and a string constant to the "type" input, and it gives you back the content.)  You then just parse out the text.  I just simply use "Match String" and pull the data between "src="" and """ (note, that means src=" and " are the exact strings searched for.)  This gives you the URL of the images.  Then, you can input a .jpg or .gif to the Datasocket Read and grab and save teh image.&lt;BR /&gt;&lt;BR /&gt;I hope this answers your questions.  If not, email me. &lt;BR /&gt;</description>
      <pubDate>Sat, 11 May 2002 16:06:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45465#M28811</guid>
      <dc:creator>Labviewguru</dc:creator>
      <dc:date>2002-05-11T16:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45466#M28812</link>
      <description>The DataSocket does succeed in getting to the html for parsing, but it does so by downloading the whole page again.  In my case, the html is the result of ~20 seconds of processing on the other end of the Internet.  Downloading it a second time (after the user has browsed to it for viewing) is inconvenient, wasteful and basically ugly.  The html is right there in the browser... how can I get at it?  &lt;BR /&gt;&lt;BR /&gt;Incidentally, the Web Events.vi example is very tantalizing, but only two items are returned in ParamNames by the Wait On ActiveX Event.vi: the URL, and something called PDisp, which is just a text string "Microsoft Web Browser Control".  Not too helpful.&lt;BR /&gt;&lt;BR /&gt;What's needed is something that does what the View Source menu selection does everyday in Interne&lt;BR /&gt;t Explorer.  Near as I can tell, selecting View Source does not trigger any additional Internet activity, so that suggests it's possible to get at the html source without a secondary download.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be VERY much appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance. &lt;BR /&gt;</description>
      <pubDate>Thu, 23 May 2002 19:54:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45466#M28812</guid>
      <dc:creator>Scott_Jordan</dc:creator>
      <dc:date>2002-05-23T19:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45467#M28813</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I didn't get the start of this discusion, so I don't see why you need to&lt;BR /&gt;reload the page in the first place. You can use flags when loading the pages&lt;BR /&gt;(navNoReadFromCach=4, navNoWriteToCache=8) to control caching. When nothing&lt;BR /&gt;is selected, the document is reloaded from cache, use it in combination with&lt;BR /&gt;the offline property. Anyway, this is what I often use to work with the&lt;BR /&gt;browser ocx:&lt;BR /&gt;&lt;BR /&gt;To view the source inside the WebBrowser ocx, you can do the following:&lt;BR /&gt;&lt;BR /&gt;a1) Load the page;&lt;BR /&gt;a2) get the document property, this is a variant&lt;BR /&gt;a3) convert it to a MSHTML.DispHTMLDocument, using Variant To Data&lt;BR /&gt;a4) use the documentElement property to get the root document element&lt;BR /&gt;a5) use the outerHTML property to get the source code.&lt;BR /&gt;a6) close all the references!&lt;BR /&gt;&lt;BR /&gt;Note that this is not exactlly the same as 'view source'. View source is the&lt;BR /&gt;code before the browser has processed it, the method above returns the&lt;BR /&gt;resulting html.&lt;BR /&gt;&lt;BR /&gt;A better way might be to:&lt;BR /&gt;&lt;BR /&gt;b1) load the url data (using WinInet Easy Get URL Bin.vi, available on&lt;BR /&gt;internet, Moore Good Idead site, I think).&lt;BR /&gt;b2) put it in the browser, by putting the html data into it. To do this,&lt;BR /&gt;attach a string to the Naviagte2 URL (Navigate is obsolete). The string can&lt;BR /&gt;be an URL, but also html, just put about: before it:&lt;BR /&gt;&lt;BR /&gt;about:&lt;H1&gt;chapter1&lt;/H1&gt;&lt;BR /&gt;&lt;BR /&gt;b3) when an update is needed, repeat step 2.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can combine the methods:&lt;BR /&gt;&lt;BR /&gt;c1) load it and get the data from step a1) to a6)&lt;BR /&gt;c2) put it in the browser using b2)&lt;BR /&gt;&lt;BR /&gt;Note that this might not work, the about: method is not suitable for all&lt;BR /&gt;html data. E.g. links to reletive URL's are not working, because the base&lt;BR /&gt;URL is different!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Wiebe.&lt;BR /&gt;&lt;BR /&gt;"Scott Jordan" &lt;X&gt; wrote in message&lt;BR /&gt;news:506500000005000000727A0000-1021771306000@exchange.ni.com...&lt;BR /&gt;&amp;gt; The DataSocket does succeed in getting to the html for parsing, but it&lt;BR /&gt;&amp;gt; does so by downloading the whole page again.  In my case, the html is&lt;BR /&gt;&amp;gt; the result of ~20 seconds of processing on the other end of the&lt;BR /&gt;&amp;gt; Internet.  Downloading it a second time (after the user has browsed to&lt;BR /&gt;&amp;gt; it for viewing) is inconvenient, wasteful and basically ugly.  The&lt;BR /&gt;&amp;gt; html is right there in the browser... how can I get at it?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Incidentally, the Web Events.vi example is very tantalizing, but only&lt;BR /&gt;&amp;gt; two items are returned in ParamNames by the Wait On ActiveX Event.vi:&lt;BR /&gt;&amp;gt; the URL, and something called PDisp, which is just a text string&lt;BR /&gt;&amp;gt; "Microsoft Web Browser Control".  Not too helpful.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; What's needed is something that does what the View Source menu&lt;BR /&gt;&amp;gt; selection does everyday in Internet Explorer.  Near as I can tell,&lt;BR /&gt;&amp;gt; selecting View Source does not trigger any additional Internet&lt;BR /&gt;&amp;gt; activity, so that suggests it's possible to get at the html source&lt;BR /&gt;&amp;gt; without a secondary download.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Any suggestions would be VERY much appreciated.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Thanks in advance.&lt;BR /&gt;&lt;/X&gt;</description>
      <pubDate>Fri, 24 May 2002 09:07:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45467#M28813</guid>
      <dc:creator>wiebe@CARYA</dc:creator>
      <dc:date>2002-05-24T09:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45468#M28814</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I didn't get the start of this discusion, so I don't see why you need to&lt;BR /&gt;reload the page in the first place. You can use flags when loading the pages&lt;BR /&gt;(navNoReadFromCach=4, navNoWriteToCache=8) to control caching. When nothing&lt;BR /&gt;is selected, the document is reloaded from cache, use it in combination with&lt;BR /&gt;the offline property. Anyway, this is what I often use to work with the&lt;BR /&gt;browser ocx:&lt;BR /&gt;&lt;BR /&gt;To view the source inside the WebBrowser ocx, you can do the following:&lt;BR /&gt;&lt;BR /&gt;a1) Load the page;&lt;BR /&gt;a2) get the document property, this is a variant&lt;BR /&gt;a3) convert it to a MSHTML.DispHTMLDocument, using Variant To Data&lt;BR /&gt;a4) use the documentElement property to get the root document element&lt;BR /&gt;a5) use the outerHTML property to get the source code.&lt;BR /&gt;a6) close all the references!&lt;BR /&gt;&lt;BR /&gt;Note that this is not exactlly the same as 'view source'. View source is the&lt;BR /&gt;code before the browser has processed it, the method above returns the&lt;BR /&gt;resulting html.&lt;BR /&gt;&lt;BR /&gt;A better way might be to:&lt;BR /&gt;&lt;BR /&gt;b1) load the url data (using WinInet Easy Get URL Bin.vi, available on&lt;BR /&gt;internet, Moore Good Idead site, I think).&lt;BR /&gt;b2) put it in the browser, by putting the html data into it. To do this,&lt;BR /&gt;attach a string to the Naviagte2 URL (Navigate is obsolete). The string can&lt;BR /&gt;be an URL, but also html, just put about: before it:&lt;BR /&gt;&lt;BR /&gt;about:&lt;H1&gt;chapter1&lt;/H1&gt;&lt;BR /&gt;&lt;BR /&gt;b3) when an update is needed, repeat step 2.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can combine the methods:&lt;BR /&gt;&lt;BR /&gt;c1) load it and get the data from step a1) to a6)&lt;BR /&gt;c2) put it in the browser using b2)&lt;BR /&gt;&lt;BR /&gt;Note that this might not work, the about: method is not suitable for all&lt;BR /&gt;html data. E.g. links to reletive URL's are not working, because the base&lt;BR /&gt;URL is different!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Wiebe.&lt;BR /&gt;&lt;BR /&gt;"Scott Jordan" &lt;X&gt; wrote in message&lt;BR /&gt;news:506500000005000000727A0000-1021771306000@exchange.ni.com...&lt;BR /&gt;&amp;gt; The DataSocket does succeed in getting to the html for parsing, but it&lt;BR /&gt;&amp;gt; does so by downloading the whole page again.  In my case, the html is&lt;BR /&gt;&amp;gt; the result of ~20 seconds of processing on the other end of the&lt;BR /&gt;&amp;gt; Internet.  Downloading it a second time (after the user has browsed to&lt;BR /&gt;&amp;gt; it for viewing) is inconvenient, wasteful and basically ugly.  The&lt;BR /&gt;&amp;gt; html is right there in the browser... how can I get at it?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Incidentally, the Web Events.vi example is very tantalizing, but only&lt;BR /&gt;&amp;gt; two items are returned in ParamNames by the Wait On ActiveX Event.vi:&lt;BR /&gt;&amp;gt; the URL, and something called PDisp, which is just a text string&lt;BR /&gt;&amp;gt; "Microsoft Web Browser Control".  Not too helpful.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; What's needed is something that does what the View Source menu&lt;BR /&gt;&amp;gt; selection does everyday in Internet Explorer.  Near as I can tell,&lt;BR /&gt;&amp;gt; selecting View Source does not trigger any additional Internet&lt;BR /&gt;&amp;gt; activity, so that suggests it's possible to get at the html source&lt;BR /&gt;&amp;gt; without a secondary download.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Any suggestions would be VERY much appreciated.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Thanks in advance.&lt;BR /&gt;&lt;/X&gt;</description>
      <pubDate>Fri, 24 May 2002 09:37:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45468#M28814</guid>
      <dc:creator>wiebe@CARYA</dc:creator>
      <dc:date>2002-05-24T09:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45469#M28815</link>
      <description>Thank you!  I'll try all your suggestions.&lt;BR /&gt;&lt;BR /&gt;Is this documented anywhere?  I've spent hours and hours looking for guidance. &lt;BR /&gt;</description>
      <pubDate>Fri, 24 May 2002 14:46:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45469#M28815</guid>
      <dc:creator>Scott_Jordan</dc:creator>
      <dc:date>2002-05-24T14:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45470#M28816</link>
      <description>Thanks to the contributions of Cyril at NI and the participants in this thread, I am now the proud possessor of code that works beautifully for extracting the html of a page displayed in a LabVIEW-embedded browser.  See the .LLB attached to this post.&lt;BR /&gt;&lt;BR /&gt;Thanks, all! &lt;BR /&gt;</description>
      <pubDate>Sat, 25 May 2002 00:22:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45470#M28816</guid>
      <dc:creator>Scott_Jordan</dc:creator>
      <dc:date>2002-05-25T00:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45471#M28817</link>
      <description>Your welkom,&lt;BR /&gt;&lt;BR /&gt;I get my info from www.microsoft.com, and the ms's sdks (downloadable from&lt;BR /&gt;ms) and msdn (just type e.g. DispHTMLDocument, and you'll get link, mostly&lt;BR /&gt;..NET, but also WebBrowser2 info)  .&lt;BR /&gt;&lt;BR /&gt;Examples from vb, vc++ and javascript are sometimes helpfull, but need&lt;BR /&gt;mapping (to LV).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Wiebe.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"Scott Jordan" &lt;X&gt; wrote in message&lt;BR /&gt;news:5065000000050000009D7A0000-1021771306000@exchange.ni.com...&lt;BR /&gt;&amp;gt; Thank you!  I'll try all your suggestions.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Is this documented anywhere?  I've spent hours and hours looking for&lt;BR /&gt;&amp;gt; guidance. &lt;BR /&gt;&lt;/X&gt;</description>
      <pubDate>Mon, 27 May 2002 08:07:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/45471#M28817</guid>
      <dc:creator>wiebe@CARYA</dc:creator>
      <dc:date>2002-05-27T08:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Web Browser ActiveX question</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/282824#M149244</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Did anyone actually work out how to directly save an object referenced within a web page?&amp;nbsp; I've&amp;nbsp;had a play with the ideas contained in this thread and can replicate Scott's findings where you are prompted&amp;nbsp; when calling the ExecWB method.&amp;nbsp; However the inputs to this call do not work as I would expect (the filepath provided is ignored, as is the 'don't prompt user' constant).&lt;/P&gt;
&lt;P&gt;I don't understand the suggestion made previously about using datasocket reads and putting a 'jpg or gif' (or any other file type for that matter) into it.&lt;/P&gt;
&lt;P&gt;Basically I'm looking to expand on Scott's VI and I need assistance.&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;regards&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Andy&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Oct 2005 11:30:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Web-Browser-ActiveX-question/m-p/282824#M149244</guid>
      <dc:creator>BadJelly</dc:creator>
      <dc:date>2005-10-28T11:30:19Z</dc:date>
    </item>
  </channel>
</rss>

