473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using Web Browser in Windows Forms

I'm using web browser to view web page in vb form......I wanna read
how much <div> is in the page ( it should be 3), but can't work
it.....In javascript it's gonna be something like this.......
(browser-object.contentDocument.documentElement.childNodes. item(1).childNodes).....I
already using the ihtmldocument, but not working out...

Example html page :

<body>
<div id="1">
------
</div>
<div id="2">
------
</div>
<div id="3">
------
</div>
</body>

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 21 '05 #1
1 1450
I thought you could do something as simple as
browser.document.all.tags("DIV").length, but it's not working. The
following function does it, but if the document is large, it can take a
while:

Public Function GetTagCount(ByVal browser As AxSHDocVw.AxWebBrowser,
ByVal tag As String)
Dim count As Integer = 0
For Each o As Object In browser.Document.all
If UCase(o.tagname) = UCase(tag) Then
count += 1
End If
Next
Return count
End Function

Scott Swigart
blog - http://ea.3leaf.com

"jokolee" <jo**@jau.co-dot-id.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
I'm using web browser to view web page in vb form......I wanna read
how much <div> is in the page ( it should be 3), but can't work
it.....In javascript it's gonna be something like this.......
(browser-object.contentDocument.documentElement.childNodes. item(1).childNodes).....I
already using the ihtmldocument, but not working out...

Example html page :

<body>
<div id="1">
------
</div>
<div id="2">
------
</div>
<div id="3">
------
</div>
</body>

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Elliott | last post by:
I have created an application that loads assemblies (plugins). These plugins are windows forms that have an embedded browser. private AxSHDocVw.AxWebBrowser browser; If I comment out...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
2
by: thechaosengine | last post by:
Hi eveyone, If anyone could advise on the following I would be truly greatful: I have a fairly standard set up. An IIS 5.1 website set up with anonymous access allowed in all areas of the site...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
0
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
3
by: Rob | last post by:
Hi all, I am having trouble converting the code below (found on http://vbnet.mvps.org/index.html?code/core/sendmessage.htm) into a format that will work using vb .NET. Can anyone have a look...
6
by: Alec MacLean | last post by:
Hi, I've created a small application for our company extranet (staff bulletins) that outputs a list of links to PDF's that are stored in a SQL table. The user clicks a link and the PDF is...
0
by: eddie69 | last post by:
Hi, My application has a Toolstrip with a Help button which launches a htm help file. It works fine when the system's default browser is IE. When Firefox is set as default, the application...
5
by: Reds | last post by:
HI, I have just started using Web Forms. It seems that I'm not able to do some things that Windows Forms allow me to do. For example, I tried to implement a counter using a module level...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.