web browser automation

view selection source through a web browser

Page 1 of 1

1 Replies - 4738 Views - Last Post: 28 April 2010 - 04:55 AM Rate Topic: -----

#1 sumit_coder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-April 10

web browser automation

Posted 28 April 2010 - 12:43 AM

Hiii friends,

I am creating a C# Windows Forms Application and I am using web browser automation. I want to select all contents of webpage shown by web browser(same as we do Ctrl+A in a normal browser), I have succeeded in doing so,this is the code for that(myWebBrowser.document.ExecCommand("SelectAll", true, null);Attached Image), now I want is to view the Selection Source(like in normal browser we do Ctrl+A and then Right Click>>View Selection Source). Can anyone help me with some code to do that???
Any help is greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: web browser automation

#2 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1536
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: web browser automation

Posted 28 April 2010 - 04:55 AM

Are you simply wanting to see the source of the page? If so, the WebBrowser has a property called DocumentText. This contains the HTML source of the current page.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1