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 HTML source of a frame using the WebBrowser windows form object

Getting HTML source of a frame using the WebBrowser windows form object

Scheduled Pinned Locked Moved C#
htmldatabasealgorithmshelptutorial
1 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.
  • J Offline
    J Offline
    Jay Gatsby
    wrote on last edited by
    #1

    Hello. I've got a little problem I've been having a hard time solving. I'm trying to use the web browser control on a windows form to get the html of a frame that the given page contains. I can't just simply use the url of that inner frame, because with each login to this site it has an appended session ID on the url and other such a=b&c=d&e=f nonsense that changes from session to session. Digging through google I found mention of webBrowser1.Document.Window.Frames[0 /*or any other index for that matter, but in my case there is only 1 element*/ ].Document.Body but this threw a System.UnauthorizedAccessException when I tried it. Ultimately, what I'm going for is a rather simplistic project but it's giving me fits on this point. I'd like to be able to login on this form on ogame.org and have it refresh every five minutes, searching the contents of "mainframe" for the word "hostile" - and if this is found, sound an alarm (system speaker et all), as this would mean one of my planets has an incoming attack, and I know how to do all of this except getting the damn mainframe's source. I know it shouldn't be too hard to do - in my opera browser I can just right click, go to the frame menu, and open it up just fine, and that's the source I want! but I can't get this out of my web browser control. all I can get is-- [code] OGame.org frame = document.getElementsByName['mainframe'][0]; if ( typeof( wi</x-turndown>

    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