473,695 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read page info from WebBrowser control?

I am able to place values on forms that load into my webbrowser control, but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine that
will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and produce
some output.

Thanks!
Jul 17 '05 #1
7 7977
You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
I am able to place values on forms that load into my webbrowser control, but I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine that
will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple as they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and produce
some output.

Thanks!

Jul 17 '05 #2
Can you send an enter key press?

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:At******** *********@newsr ead3.news.atl.e arthlink.net...
You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
I am able to place values on forms that load into my webbrowser control, but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine that will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and

produce some output.

Thanks!


Jul 17 '05 #3
You mean send it to the page?

'-- assuming you've got the document object as Doc:

Dim TR As IHTMLTxtRange
Set TR = Doc.Body.Create TextRange
TR.pasteHtml "<BR>"
(You may need to also paste a "#nbsp;" to actually
show the return in the page. And you can use the Move,
MoveToPoint, etc. methods to position where the return
happens.)

If you mean a SendKeys to the WB window, in order
to "click" something, I don't know the best way to do that.
Can you send an enter key press?

You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
I am able to place values on forms that load into my webbrowser
control,
but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine

that will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple
as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and

produce some output.

Thanks!



Jul 17 '05 #4
Hi mayayana,

How could you move a vertical scroll bar down to the bottom?

My problem is that when I insert a line of text into an Internet
Explorer_Server window, the document fails to scroll up, and so the new line
of text is not visible (unless I manually scroll up by clicking the bottom
of the scroll bar).
PS. Could someone please repost this message to the original list of
newsgroups
(comp.lang.basi c.visual,comp.l ang.visual.basi c,microsoft.pub lic.vb.controls .
internet) as I only have access to the MS news server, and I don't think
mayayana is subscribed here. Thanks.

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:At******** *********@newsr ead3.news.atl.e arthlink.net...
You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
I am able to place values on forms that load into my webbrowser control, but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine that will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and

produce some output.

Thanks!


Jul 17 '05 #5
I'm not sure about that. You can scroll the page with this:
WB.Document.bod y.scrolltop

It's a Read/Write Long value in pixels that can return or set
the pixel point showing at the top of the browser window.
To scroll to the bottom I guess you'd need to get the page height
and window height to figure it out. Or maybe you could just
set scrolltop to something very large. In other words, if the
page is 800 pixels high and the window is 700 pixels high
then setting scrolltop to 100 would scroll to the bottom. I'm
guessing that setting scrolltop to, say, 2000 might also work.
How could you move a vertical scroll bar down to the bottom?

My problem is that when I insert a line of text into an Internet
Explorer_Server window, the document fails to scroll up, and so the new line of text is not visible (unless I manually scroll up by clicking the bottom
of the scroll bar).
PS. Could someone please repost this message to the original list of
newsgroups
(comp.lang.basi c.visual,comp.l ang.visual.basi c,microsoft.pub lic.vb.controls . internet) as I only have access to the MS news server, and I don't think
mayayana is subscribed here. Thanks.

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:At******** *********@newsr ead3.news.atl.e arthlink.net...
You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
I am able to place values on forms that load into my webbrowser
control,
but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplet e routine

that will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple
as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and

produce some output.

Thanks!



Jul 17 '05 #6
Hi mayayana,

My object doesn't seem to have that property. I've tried several other
suggestions seen on Web sites too, but none of them seem to work with this
object.

I'm using this code
http://www.planet-source-code.com/vb...50433&lngWId=1
to attach onto the new Yahoo! Messenger 6 BETA's
http://messenger.yahoo.com/beta/winbeta.php IM windows (Yahoo! uses the
Internet Explorer_Server ). The code works very well.

My program inserts a status message into my IM window. If Messenger already
had a status message showing in the window, then my program deletes the
status HTML code and inserts my own to show the new status message. This
works seemlessly.

The problem only arrises when there wasn't already a status there. If I just
insert my own status, the IM window doesn't scroll up as it normally does.
The user is left to scroll up manually, although from then on the window
scrolls automatically as normal.

I've compared all the innerHTML and outerHTML code of when Messenger inserts
it's status with when my program inserts a status, and they are identicle.

So the question is, when Messenger inserts a status for the first time, what
else does it do to ensure the window scrolls? I've seen a .autoscroll
method, but it had no effect either.

Any ideas? I suppose I would be too lucky if you're a Yahoo! Messenger user
:)

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:yr******** ***********@new sread3.news.atl .earthlink.net. ..
I'm not sure about that. You can scroll the page with this:
WB.Document.bod y.scrolltop

It's a Read/Write Long value in pixels that can return or set
the pixel point showing at the top of the browser window.
To scroll to the bottom I guess you'd need to get the page height
and window height to figure it out. Or maybe you could just
set scrolltop to something very large. In other words, if the
page is 800 pixels high and the window is 700 pixels high
then setting scrolltop to 100 would scroll to the bottom. I'm
guessing that setting scrolltop to, say, 2000 might also work.
How could you move a vertical scroll bar down to the bottom?

My problem is that when I insert a line of text into an Internet
Explorer_Server window, the document fails to scroll up, and so the new

line
of text is not visible (unless I manually scroll up by clicking the bottom
of the scroll bar).
PS. Could someone please repost this message to the original list of
newsgroups

(comp.lang.basi c.visual,comp.l ang.visual.basi c,microsoft.pub lic.vb.controls .
internet) as I only have access to the MS news server, and I don't think
mayayana is subscribed here. Thanks.

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:At******** *********@newsr ead3.news.atl.e arthlink.net...
You need to research the IE DOM. It's all there.
The "all" collection gives you all tags in the page.
Each item in the "all" collection is an IHTMLElement
object. An IHTMLElement may also have children
IHTMLElements. Each has a Tagname property,
access to get and put attributes, catch events, etc.
You can do just about anything to the page that you
want to.

--
--
Noozer <do*******@me.h ere> wrote in message
news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
> I am able to place values on forms that load into my webbrowser control, but
> I'd like to be able to scan the page for data. I know to use the
> HTMLDocument object.
>
> Basically I'm hoping to find an example of a DocumentComplet e routine that
> will:
>
> - display a list of all elements (tags?) on the page
> - number of forms on the page
> - ID, name, type and value for each field on the form
> - and how I should handle a page with multiple frames.
>
> I've found numerous examples through Google, but they are all VERY

simple
as
> they assume you know what form index and element names are on the

page > already. I can't find any samples that can scan a random page and

produce
> some output.
>
> Thanks!
>
>



Jul 17 '05 #7
Sorry. I've never used IM, so I only have a vague
idea of what you're talking about.

--

My object doesn't seem to have that property. I've tried several other
suggestions seen on Web sites too, but none of them seem to work with this
object.

I'm using this code
http://www.planet-source-code.com/vb...odeId=50433&ln
gWId=1 to attach onto the new Yahoo! Messenger 6 BETA's
http://messenger.yahoo.com/beta/winbeta.php IM windows (Yahoo! uses the
Internet Explorer_Server ). The code works very well.

My program inserts a status message into my IM window. If Messenger already had a status message showing in the window, then my program deletes the
status HTML code and inserts my own to show the new status message. This
works seemlessly.

The problem only arrises when there wasn't already a status there. If I just insert my own status, the IM window doesn't scroll up as it normally does.
The user is left to scroll up manually, although from then on the window
scrolls automatically as normal.

I've compared all the innerHTML and outerHTML code of when Messenger inserts it's status with when my program inserts a status, and they are identicle.

So the question is, when Messenger inserts a status for the first time, what else does it do to ensure the window scrolls? I've seen a .autoscroll
method, but it had no effect either.

Any ideas? I suppose I would be too lucky if you're a Yahoo! Messenger user :)

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:yr******** ***********@new sread3.news.atl .earthlink.net. ..
I'm not sure about that. You can scroll the page with this:
WB.Document.bod y.scrolltop

It's a Read/Write Long value in pixels that can return or set
the pixel point showing at the top of the browser window.
To scroll to the bottom I guess you'd need to get the page height
and window height to figure it out. Or maybe you could just
set scrolltop to something very large. In other words, if the
page is 800 pixels high and the window is 700 pixels high
then setting scrolltop to 100 would scroll to the bottom. I'm
guessing that setting scrolltop to, say, 2000 might also work.
How could you move a vertical scroll bar down to the bottom?

My problem is that when I insert a line of text into an Internet
Explorer_Server window, the document fails to scroll up, and so the new
line
of text is not visible (unless I manually scroll up by clicking the bottom of the scroll bar).
PS. Could someone please repost this message to the original list of
newsgroups

(comp.lang.basi c.visual,comp.l ang.visual.basi c,microsoft.pub lic.vb.controls . internet) as I only have access to the MS news server, and I don't think mayayana is subscribed here. Thanks.

"mayayana" <ma************ @mindZZspring.c om> wrote in message
news:At******** *********@newsr ead3.news.atl.e arthlink.net...
> You need to research the IE DOM. It's all there.
> The "all" collection gives you all tags in the page.
> Each item in the "all" collection is an IHTMLElement
> object. An IHTMLElement may also have children
> IHTMLElements. Each has a Tagname property,
> access to get and put attributes, catch events, etc.
> You can do just about anything to the page that you
> want to.
>
> --
> --
> Noozer <do*******@me.h ere> wrote in message
> news:mv_oc.4753 30$Ig.437986@pd 7tw2no...
> > I am able to place values on forms that load into my webbrowser

control,
> but
> > I'd like to be able to scan the page for data. I know to use the
> > HTMLDocument object.
> >
> > Basically I'm hoping to find an example of a DocumentComplet e routine that
> > will:
> >
> > - display a list of all elements (tags?) on the page
> > - number of forms on the page
> > - ID, name, type and value for each field on the form
> > - and how I should handle a page with multiple frames.
> >
> > I've found numerous examples through Google, but they are all VERY
simple
> as
> > they assume you know what form index and element names are on the page > > already. I can't find any samples that can scan a random page and
produce
> > some output.
> >
> > Thanks!
> >
> >
>
>



Jul 17 '05 #8

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

Similar topics

3
303
by: Danny | last post by:
I have to create a database of products and i need to do it by reading the HTML to derive fields. I did this fine, but their are so many other pages within each category, for example: the next page button will take you to the next pages etc etc. Does anybody know a way I can follow these links and read the html? Thakns in advance
0
720
by: Noah Coad [MVP .NET/C#] | last post by:
How does one gain access to the WebBrowser (SHDocVw) control to the extent of the one used in VS.NET Start Page? I'm familiar with using the control directly, I've written a tutorial on it, and am familiar with HTML Applications (HTA), but how are features like the right-click context sensitive menu and selection diabled in VS.NET's Start Page? If I attempt to make a WebBrowser control navigate to an HTA file, it brings up a dialog...
1
1237
by: DEWright_CA | last post by:
Hello Everyone! I am curious if anyone has done anything so automate the scaling of controls based on screen resolution. In my case I have a minimum screen res of 1024x768 for my page size, which I designed to, but I know a lot of people are now using 1280+ and am looking for any examples of ways to in code behind do something like this. if (screen.width < 1024) {
3
15597
by: Pete | last post by:
Using C# and a web browser control, is there a way to programatically click a web page button?
24
2971
by: Randall Arnold | last post by:
I know how to use MSHTML to grab the innerhtml from an html web page, but what if I want to look at elements of a rendered aspx page? Is there any way to do this using the MSHTML DOM object? Thanks, Randall Arnold
2
5254
by: Jim S | last post by:
I have a need to read the contents of an html table on a remote web page into a variable. I guess this is called screen scraping but not sure. I'm not sure where to start or what the best practices are to accomplish this. For instance; I have a healthcare app that need to check a gov't we page for a user's license no# periodically. There is no login and I can put the user info in the request URL no problem but not sure how to read the...
4
2686
by: Michael Duclon | last post by:
Does anyone know how I might use the webclient class to navigate to a web page in a vb.net app, and then if a JavaScript popup appears from the web page I go to, read the message in it or content of it, then close it so I can continue on. I don't know how to reference the popup box or send a command to click the ok button to close it. Mike Duclon
4
4476
by: kimiraikkonen | last post by:
Hi, Just to test, i placed a simple webbrowser to login a site, this site has no problems and has same error with IE6 SP2 but it's suppressed as well and no problem with Firefox browser, but using webbrowser it shows scripting errors: There are a lot more sites that encounters scripting problems though they work just fine in Firefox, a sample: http://www.anaivanovic.com/forum/login.php
1
12610
by: Tim Sprout | last post by:
I want to call Page Setup to set default printer and page size and orientation before batch printing pdf's silently from WebBrowser controls. I can print silently using DDE (the NDde library) or Adobe Interapplication Communication (IAC) DotNet API. There is no Adobe DDE command or IAC API for Page Setup. I don't see a print silent method for the WebBrowser control. I can get a Page Setup dialog to appear by using the code below, but the...
0
8617
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8553
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8971
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8815
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7650
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6483
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5827
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4332
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.