473,799 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

View browser page source from another app?

How can I get the page source from a browser window running on the same
box as my program?

shishudas

*** Sent via Developersdex http://www.developersdex.com ***
Jan 4 '06 #1
8 1383
"Shishu Das" <sh********@gma il.com> schrieb:
How can I get the page source from a browser window running on the same
box as my program?


If you are using Internet Explorer:

\\\

' Requires a reference to "Microsoft Internet Controls" ("SHDocVw.dll") .
On Error Resume Next
For Each IE As InternetExplore r In New ShellWindows
MsgBox(IE.Docum ent.DocumentEle ment.innerHTML)
Next IE
On Error GoTo -1
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jan 4 '06 #2
Herfried's solution will get you the current state of the DOM including
DHTML modifications - this is probably what you want. In the case that you
want to display the "true" source (what was initially downloaded) see
http://support.microsoft.com/?kbid=311288

--
Colin Neller
http://www.colinneller.com/blog
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
"Shishu Das" <sh********@gma il.com> schrieb:
How can I get the page source from a browser window running on the same
box as my program?


If you are using Internet Explorer:

\\\

' Requires a reference to "Microsoft Internet Controls" ("SHDocVw.dll") .
On Error Resume Next
For Each IE As InternetExplore r In New ShellWindows
MsgBox(IE.Docum ent.DocumentEle ment.innerHTML)
Next IE
On Error GoTo -1
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 4 '06 #3
Herfried,

Thanks! But, can you explain how to do this "reference" in VB.Net. I'm
new to this platform, and haven't fully RTFM.

Thanks!

shishudas

' Requires a reference to "Microsoft Internet Controls" ("SHDocVw.dll") .
*** Sent via Developersdex http://www.developersdex.com ***
Jan 4 '06 #4
"Shishu Das" <sh********@gma il.com> schrieb:
Thanks! But, can you explain how to do this "reference" in VB.Net. I'm
new to this platform, and haven't fully RTFM.


"Project" -> "Add reference..." -> "COM" -> "Microsoft Internet Controls".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jan 4 '06 #5
Got the reference OK, but it's still not liking this syntax. Just to
make this a little harder, I should mention that I would like to detect
(with a global hook) where the user clicked on the web page, so I can
tell what section of text they are looking at...

shishudas


*** Sent via Developersdex http://www.developersdex.com ***
Jan 4 '06 #6
shishudas,

I suggest you try using the C# WebBrowser wrapper available at
http://www.codeproject.com/cs/miscctrl/WebBrowserEx.asp. It does a lot of
the "pluming" required to make the WebBrowser behave like you want
(including sinking the IHTMLDocument2 to capture click events.) Also, I
have a blog post that lists several WebBrowser control resources I have
found useful:
http://www.colinneller.com/blog/Perm...15665bc5d.aspx

--
Colin Neller
http://www.colinneller.com/blog
"Shishu Das" <sh********@gma il.com> wrote in message
news:ek******** ******@TK2MSFTN GP09.phx.gbl...
Got the reference OK, but it's still not liking this syntax. Just to
make this a little harder, I should mention that I would like to detect
(with a global hook) where the user clicked on the web page, so I can
tell what section of text they are looking at...

shishudas

Jan 4 '06 #7

Colin,

Thanks again!

I notice a reference to new features in .Net 2.0 that might make this
easier. Should I just upgrade to the new version and use those? Are you
familiar with them?

shishudas

*** Sent via Developersdex http://www.developersdex.com ***
Jan 4 '06 #8
shishudas,

Honestly, I have no experience with the 2.0 WebBrowser control other than
small test applications. If you want FULL control over the WebBrowser,
you're probably better off doing it yourself (starting with the wrapper),
but if you can live with the limited functionality that the 2.0 control
gives you, do it... it's MUCH easier.

--
Colin Neller
http://www.colinneller.com/blog
"Shishu Das" <sh********@gma il.com> wrote in message
news:uU******** ******@TK2MSFTN GP15.phx.gbl...

Colin,

Thanks again!

I notice a reference to new features in .Net 2.0 that might make this
easier. Should I just upgrade to the new version and use those? Are you
familiar with them?

shishudas

*** Sent via Developersdex http://www.developersdex.com ***

Jan 4 '06 #9

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

Similar topics

5
7213
by: Pete Wason | last post by:
Hiall! I have a demo viewer page for javascript stuff that has three buttons "DEMO" "HTML" and "JSCR", and an IFRAME called 'viewer'. Initially, the IFRAME gets loaded with the actual demo page, ie., viewer.location = dName + '.html'; where dName is the filename of the demo without extension.
4
2418
by: k | last post by:
A programming the internet class has been asked if it is possible to 'grey out' the View Source option in a browser menu. Multiple respondents think it is possible but not sure how to do it. I have seen the 'Print' option greyed out at some sites... Can you provide or recommend a specific way of achieving this?
8
2893
by: Nancy | last post by:
Hi, Guys, I don't know why I can't view some webpages source code by click "View->Source" menu of Browser. These webpage source code can be viewed in same way by using other computers. My OS is Win Xp and Browser is IE6.0. I don't use any fire wall. Appreciate any hint. Nancy
15
3018
by: Michael Hill | last post by:
I saw a site that looked pretty good, but I could view the source. 2 questions: 1) how can I do the same for my site 2) any way to get around this? Mike
18
2559
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
8
2246
by: Alvo von Cossel I | last post by:
hey everybody, I have written a great browser but it is missing a feature (quite a lot actually, but forget about them for now). that feature just so happens to be the View > Source function. for those of you who don't what i mean, it is when you click a button in the view menu that says Page source (in Netscape) and source (in Internet Explorer). if you click it, notepad opens. in that window is the html for the page. anyway, does...
3
2127
by: Philip Tripp | last post by:
I've read numerous sources stating that view state can be disabled per control, and per page, but can't seem to keep web form controls from remembering their state on a postback. I'm using VS.Net 2002, .Net Framework 1.0 SP2. I create a new project, and add a new web form to the project. On the page properties, I set EnableViewState to False and verify that the @ Page directive has "enableViewState=false" in it. I then add a TextBox...
3
1215
by: Frank | last post by:
Hi, I'm experimenting with aspx. When I build a form with code-behind code it's possible to run with a mouse right-click and menu 'view in browser'. A browser window is opened within VB.NET. Works fine. But after making adjustments in the vb file the changes are not available after again using the view in browser mousemenu? Probably because of caching. How do I get around that? It does work using key F5, but that takes longer. I want to...
6
1723
by: jwwishart | last post by:
For some reason I'll view an aspx page and... 1. Scripts that I add (using the RegisterStartupScript method of the Page object) dont show up in the source(IE->View Source)even thought I know that the scripts are registering fine in every other page. 2. I can see (for example) a div tag with many controls and text contained in it, yet the source (viewed in IE) doesn't even have a trace of these elements. It appears as if ALL of the...
3
2789
by: Stefan Schwarzer | last post by:
Hello, from time to time I want to inspect the source code of projects on remote computers.(*) I've googled for one or two hours but didn't find anything helpful. :-/ I'm looking for something like IDLE's path browser - i. e. a tree view and file view side-by-side - but with the following differences: - doesn't need an X connection to the remote computer where the sources are
0
10257
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...
1
10237
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10029
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
9077
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
7567
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
5467
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...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
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
3
2941
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.