search webpage

Author Message
dabing

  • Total Posts : 88
  • Scores: 0
  • Reward points : 0
  • Joined: 5/8/2009
  • Status: offline
search webpage Tuesday, May 25, 2010 9:27 AM (permalink)
0
I am trying to search for a string of text in a webpage using powershell and am not sure the syntax on it. I am able to do it through vbscript, but am not sure how it is done with PS.
 
The only example I can give that I have right now is opening the webpage. How can I search the webpage for the text "error has occurred".
 
$ie = new-object -com InternetExplorer.Application
$ie.navigate("https://www.somesite.com/")
do {sleep 1} until (-not ($ie.Busy))
$ie.visible = $true
 
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:search webpage Wednesday, May 26, 2010 12:58 AM (permalink)
    0
    Well, it will depend a little on the structure of the page, but poke around in the .Document property and look at the InnerHTML.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9