From: Abhishek on 13 Apr 2010 18:53 Hi to all, Is there a web browser syntax like WB1.Document.body.innerHTML to read the meta tag of the page loaded in web browser control? or do i need to manually write the code for that? Thanks in Advanced, -- abhishek
From: Mayayana on 13 Apr 2010 21:46 | | Is there a web browser syntax like WB1.Document.body.innerHTML to read the | meta tag of the page loaded in web browser control? | or do i need to manually write the code for that? | I don't think there's any way to get at it. It's not a property of HEAD. body.outerHTML only returns the BODY tags inclusive. And it's not a property of document.
From: mscir on 14 Apr 2010 03:54 On 4/13/2010 6:46 PM, Mayayana wrote: > | > | Is there a web browser syntax like WB1.Document.body.innerHTML to read the > | meta tag of the page loaded in web browser control? > | or do i need to manually write the code for that? > | > > I don't think there's any way to get at it. It's not > a property of HEAD. body.outerHTML only returns > the BODY tags inclusive. And it's not a property > of document. This works for me on yahoo.com, VB6, XPSP3 http://vbcity.com/forums/p/82829/342749.aspx If Not WebBrowser.Document.All("keywords") Is Nothing Then webdescriptors = webdescriptors & "Keywords: " & WebBrowser.Document.All("keywords").content & vbCrLf If Not WebBrowser.Document.All("description") Is Nothing Then webdescriptors = webdescriptors & "Description: " & WebBrowser.Document.All("description").content & vbCrLf Mike --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Mayayana on 14 Apr 2010 10:10 | This works for me on yahoo.com, VB6, XPSP3 | That works here, too, with IE6. I've never seen that before, and it's not listed in the VS6 version of MSDN. (If I look up "all" the Applies To list only includes tags, and META is not among them.) I'd be interested to see a link that fully documents this if anyone knows of one. | http://vbcity.com/forums/p/82829/342749.aspx | | If Not WebBrowser.Document.All("keywords") Is Nothing Then | webdescriptors = webdescriptors & "Keywords: " & | WebBrowser.Document.All("keywords").content & vbCrLf | | If Not WebBrowser.Document.All("description") Is Nothing Then | webdescriptors = webdescriptors & "Description: " & | WebBrowser.Document.All("description").content & vbCrLf | | Mike | | | --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: mscir on 15 Apr 2010 02:51
On 4/14/2010 7:10 AM, Mayayana wrote: > | This works for me on yahoo.com, VB6, XPSP3 > | > > That works here, too, with IE6. I've never seen that > before, and it's not listed in the VS6 version of MSDN. > (If I look up "all" the Applies To list only includes tags, > and META is not among them.) > I'd be interested to see a link that fully documents > this if anyone knows of one. About the DHTML Object Model http://msdn.microsoft.com/en-us/library/ms533022%28v=VS.85%29.aspx .....Each element object has an all collection that contains all the elements that are beneath that element in the hierarchy, and a children collection that contains only the elements that are direct descendants of that element. <snip> In addition to these collections for each element, the document itself (represented by the document object) has a number of element and nonelement collections. The most important collection is an all collection that contains all the elements on the Web page. This collection is the primary way to access elements through script. For more information about using collections, see Scripting with Elements and Collections. ------------------------------------------------------------------------ Scripting with Elements and Collections http://msdn.microsoft.com/en-us/library/ms533026%28v=VS.85%29.aspx#The_all_Collection_a .....An HTML document is a hierarchical construct of tags that define the contents of the document. The all collection on the document object represents all the elements in the document hierarchy. Each element is represented as a programmable object appearing within the collection in source order. Individual element objects are accessed by index or identifier (unique name), as shown in the following example. Copy ....<snip>... In many ways, the all collection is similar to an array. It contains one or more items, each of the same type�in this case, element objects. You access the items using zero-based index values, or by name or identifier. The first item has index value 0, the second has 1, and so on. You can determine how many items are in the collection by using the length property. Because each item in the all collection is an element object, you can apply properties and methods to these items. For example, you can use the tagName property to retrieve the HTML tag name of the element, as was done in the previous example. Similarly, you can access properties and methods of the respective element by accessing this through the document.all collection. The all collection always represents the current state of the document and is automatically updated to reflect any changes made to the document. For example, if you retrieve the collection and add or remove document content that changes the HTML structure, the collection automatically reflects the new HTML content in source order. In some cases, the all collection might contain more elements than are actually in the document's file. In particular, the collection always contains the html, head, TITLE, and BODY elements, even if these are not present in the source. Similarly, the collection always contains a tBody element for each table, regardless of whether tBody is specified in the HTML source. The all collection also includes comments (!) and unknown or invalid tags. The purpose is to give you an accurate picture of the content of the document. Unknown or invalid tags are typically misspelled or misplaced tags. Knowing what and where these tags are provides an opportunity to replace them with valid tags. The all collection lists unknown and invalid start and end tags separately; it does not attempt to combine them into a single item. ....<snip>... In addition to the all collection on the document object, each individual element also exposes an all collection. Remember the hierarchical style of HTML�this helps to think about the all collection for each element. The all collection for an element contains all the elements contained by that element. For example, the all collection for the HTML element would contain everything in the source code except the HTML element (this being the only difference between the all collection for the HTML element and the document.all collection). Each element also exposes a children collection, which contains only the elements that are direct descendants of the element in the HTML hierarchy. Another way of saying this is that the children collection contains only those elements whose parentElement property returns that element. The content of the children collection is undefined for overlapping elements. ------------------------------------------------------------------------ Mike --- news://freenews.netfront.net/ - complaints: news(a)netfront.net --- |