473,569 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.contentD ocument.documen tElement.childN odes.item(1).ch ildNodes).....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 1455
I thought you could do something as simple as
browser.documen t.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(ByV al browser As AxSHDocVw.AxWeb Browser,
ByVal tag As String)
Dim count As Integer = 0
For Each o As Object In browser.Documen t.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.contentD ocument.documen tElement.childN odes.item(1).ch ildNodes).....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
1960
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 this.browser = new AxSHDocVw.AxWebBrowser(); and associated code to avoid exceptions like this.browser.Dock = System.Windows.Forms.DockStyle.Fill;...
2
7506
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 Windows 2003 PocketPC (Windows Mobile) running Pocket IE. <html><head><title>WMS - P280WF100 - Login</title><META HTTP-EQUIV='expires' VALUE='0'>...
2
1768
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 but a secure subdirectory called /secure/ I am using windows forms authentication and this is configured in my web.config file.
15
4733
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 button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
4
3509
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 objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
0
3035
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 objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
3
5318
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 at it and let me know what I need to change. I have tried changing the "hwnd" type into intptr's but there seem to be other problems too, like it...
6
4902
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 loaded into a new browser window. This works as expected on the test PC (using forms authentication, but no SSL) using IE. It also works as expected...
0
1056
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 complains with an exection error: ************** Exception Text ************** System.ComponentModel.Win32Exception: The system cannot find the file...
5
1778
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 declaration, but it would not increment using Web Forms. Also, some controls such as textboxes, which worked OK on the computer, did not work when I placed...
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.