473,387 Members | 1,550 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,387 software developers and data experts.

Get text from Web Browser control

_B
Is there any way to 'scrape' the ascii text from an
AxSHDocView:AxWebBrowser control?

IOW, I'd like to get the text as it is displayed by the browser.
Somewhat like selecting all text in IE and doing a capture to
clipboard (^A,^C).

It seems like there should be a way to simulate sending control-A,
control-C key input to the browser control.

Nov 16 '05 #1
4 12237
There is not much text in a HTML page.

All between the <HTML>begin and end tag is called innertext and including
that it is called outertext.

However that is probably not what you are after.
When you want the HTML innertext you can use MSHTML to get that.

However keep in mind that that is the complete web page (for outertext
without in newer situation the first line) including all tags. What is text
is not easy to determinate, because it is all what is written between an
begin and an end tag (not inside a tag), while it can as well be done using
JavaScript.

mshtml
http://msdn.microsoft.com/library/de...ng/hosting.asp

I hope this helps a little bit.

Cor

Nov 16 '05 #2
_B

[re capturing text in a browser window]

On Tue, 28 Dec 2004 10:35:27 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
All between the <HTML>begin and end tag is called innertext and including
that it is called outertext.

However that is probably not what you are after.
When you want the HTML innertext you can use MSHTML to get that.


I confess that I haven't gone after the innertext yet cause I need
some whitespace stuff that's probably relegated to outer text, like
<nbsp> etc. If I could do the equivalent of sending in a ^A^C
(select-all, capture), I'd be home free. I thought there would
probably be a simple way to do that. I haven't seen that done before
though, so it's probably not easy.

Thanks for your reply, Cor.
Nov 16 '05 #3
First time on this site (didn't even know it existed!)... My question has
similarities to the latest post. I was going to pose a new question, but
something wasn't working. Ultimately I will want to copy text from an HTML
window, just as the latest post posed. But before that, I want to figure out
how to display a menu bar on my HTML window. My user is quite happy with my
solution of using MSHTML and the function ShowHTML() to display records from
an Access database containing HTML. But it is also desired to print or copy
the data in the window. It has been quite some tiome since I wrote the
application so my memory is hazy. But I remember spending quite some time in
futility trying to figure out how to also have a menu with my ShowHTML
window. I am using C++ in Visual Studio.net.
Thanks,
Mark

"_B" wrote:

[re capturing text in a browser window]

On Tue, 28 Dec 2004 10:35:27 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
All between the <HTML>begin and end tag is called innertext and including
that it is called outertext.

However that is probably not what you are after.
When you want the HTML innertext you can use MSHTML to get that.


I confess that I haven't gone after the innertext yet cause I need
some whitespace stuff that's probably relegated to outer text, like
<nbsp> etc. If I could do the equivalent of sending in a ^A^C
(select-all, capture), I'd be home free. I thought there would
probably be a simple way to do that. I haven't seen that done before
though, so it's probably not easy.

Thanks for your reply, Cor.

Nov 16 '05 #4
On 28/12/2004 _B wrote:

[re capturing text in a browser window]

On Tue, 28 Dec 2004 10:35:27 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
All between the <HTML>begin and end tag is called innertext and
including that it is called outertext.

However that is probably not what you are after.
When you want the HTML innertext you can use MSHTML to get that.


I confess that I haven't gone after the innertext yet cause I need
some whitespace stuff that's probably relegated to outer text, like
<nbsp> etc. If I could do the equivalent of sending in a ^A^C
(select-all, capture), I'd be home free. I thought there would
probably be a simple way to do that. I haven't seen that done before
though, so it's probably not easy.

Thanks for your reply, Cor.


I use the following to copy text from the DHTML edit control to a
RichEdit control if it's any use:

private void JConvertHTM2RTF(string strFQSource)
{
object obfile = new object();
object ob = new object();

obfile = strFQSource;
axDHTMLEdit1.NewDocument();
axDHTMLEdit1.LoadDocument(ref obfile, ref ob);

rtfDest.Text = "";
axDHTMLEdit1.Focus();
SendKeys.SendWait("^a^c");
rtfDest.Focus();
SendKeys.SendWait("^a^v");
}

--
Jeff Gaines
Posted with XanaNews 1.17.1.2 http://www.wilsonc.demon.co.uk/delphi.htm
Nov 16 '05 #5

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

Similar topics

0
by: Mirano | last post by:
Hi everybody. I open a Word document in the web browser control, I then select some text in it using a mouse, and I want to paste the selected text into another text box on the same form, but it...
7
by: Mike Casey | last post by:
Hello all, I have ASP.NET label controls tied to a datasource (so text will vary in length depending on the record). In IE everything looks great--text is wrapped if needed. In Netscape and...
3
by: _eee_ | last post by:
Does anyone have a pointer to code for: 1 Filtering text from html? (removing html tags, etc) 2 Displaying HTML in a windows form or any other useful utilities for dealing with raw HTML.
3
by: Andla Rand | last post by:
Hi, I would appreciate some directions on how to replace text as server controls. I'm currently reading text from a database and would like to build server logic based on specific information...
1
by: nospamjac | last post by:
Hi, Is there a way to update the text of an asp:label on a webform without refreshing the entire page? What is called by button clicks and other events that refresh a webform control? See the...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
5
by: dpomt | last post by:
When the ASP.NET menu is rendered on downlevel browers, the text "^ up one level" is displayed. Any ideas how I can change that text? I did not find a property for the menu control where I can...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
2
by: Rishabh Indianic | last post by:
Hi, i display some text in web browser control from my xml file. now i want to search specific word in web browser control and highlight that text. to do this thing i am trying to get text from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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,...

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.