Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. getting a specific tag out of a web page Dom info [modified]

getting a specific tag out of a web page Dom info [modified]

Scheduled Pinned Locked Moved C#
csharphtmlvisual-studiocomquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manustone
    wrote on last edited by
    #1

    Hi All I am creating an application in order to get the DOM info of a Web Page. I cannot extract a TBODY tag using my application. I am using *the control WebBrowser shipped by Visual Studio *a reference to the Com Microsoft.mshtml 7.0.3300.0 If I use the "Internet Explorer Developer Toolbar" I can see all information I need. The <TBODY> tag has id "tbody_rank_by_level" and carries a list of <TR> tags full of data that are showed in attributes innertHTML and innertText. Using the code below innertHtml and innertText are both null. What I am doing wrong?

    mshtml.IHTMLDocument3 domDoc = this.webBrowser.Document.DomDocument as mshtml.IHTMLDocument3;
    mshtml.IHTMLElement element = domDoc.getElementById("tbody_rank_by_level");
    String innerHtml = element.innerHTML;
    String innerText = element.innerText;

    modified on Monday, January 11, 2010 3:07 PM

    M 1 Reply Last reply
    0
    • M manustone

      Hi All I am creating an application in order to get the DOM info of a Web Page. I cannot extract a TBODY tag using my application. I am using *the control WebBrowser shipped by Visual Studio *a reference to the Com Microsoft.mshtml 7.0.3300.0 If I use the "Internet Explorer Developer Toolbar" I can see all information I need. The <TBODY> tag has id "tbody_rank_by_level" and carries a list of <TR> tags full of data that are showed in attributes innertHTML and innertText. Using the code below innertHtml and innertText are both null. What I am doing wrong?

      mshtml.IHTMLDocument3 domDoc = this.webBrowser.Document.DomDocument as mshtml.IHTMLDocument3;
      mshtml.IHTMLElement element = domDoc.getElementById("tbody_rank_by_level");
      String innerHtml = element.innerHTML;
      String innerText = element.innerText;

      modified on Monday, January 11, 2010 3:07 PM

      M Offline
      M Offline
      manustone
      wrote on last edited by
      #2

      I switched to csEXWB and everything was good. Still I don't understand why using WebBrowser control it doesn' work. Anyway for all interested please read this page The most complete C# Webbrowser wrapper control[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups