Struggling to filter content in string fromt HTML

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Flemming Flemming 5 months, 1 week ago.

  • Author
    Posts
  • #64128
    Profile photo of Flemming
    Flemming
    Participant

    I have filtred som info fram Invoke-WebRequest and managed to bring out the content of a specific DIV tag.
    This Content is now stored in $forecast and the content is as follows:

    
    
     
    Or
    
    Hassel
    
    Salix
    
    Bjørk
    
    Gress
    
    Burot
    
    
    ma
    ti
    ma
    ti
    ma
    ti
    ma
    ti
    ma
    ti
    ma
    ti
    
    Østlandet med Oslo
     
     
     
     
     
     
     
     
     
     
     
     
    
    Sørlandet
     
     
     
     
     
     
     
     
     
     
     
     
    
    Rogaland
     
     
     
     
     
     
     
     
     
     
     
     
    
    Hordaland
     
     
     
     
     
     
     
     
     
     
     
     
    
    Sogn og Fjordane
     
     
     
     
     
     
     
     
     
     
     
     
    
    Møre og Romsdal
     
     
     
     
     
     
     
     
     
     
     
     
    
    Indre Østlandet
     
     
     
     
     
     
     
     
     
     
     
     
    
    Sentrale fjellstrøk i Sør-Norge
     
     
     
     
     
     
     
     
     
     
     
     
    
    Trøndelag
     
     
     
     
     
     
     
     
     
     
     
     
    
    Nordland
     
     
     
     
     
     
     
     
     
     
     
     
    
    Troms
     
     
     
     
     
     
     
     
     
     
     
     
    
    Finnmark
     
     
     
     
     
     
     
     
     
     
     
     

    How Can I here for example show everything within the tags Where the word "Sentrale_fjellstrok_i_Sor-Norge.aspx" ia?

    the ultimate goal is to get the value og spesific title=

    PS:
    this is my code:

    $pollenvarsel_web = Invoke-WebRequest "http://www.pollenvarslingen.no/forsiden/varsel.aspx"
    $forecast = $pollenvarsel_web.ParsedHtml.getElementsByTagName('div') | ?{$_.ID -eq 'forecastTable'}
    Write-Host ----
    $forecast = $forecast.InnerHTML
    
    $forecast
  • #64129
    Profile photo of Flemming
    Flemming
    Participant

    i see the forum didn't show the HTML code correct, but just run my powershell code and you will se the output

You must be logged in to reply to this topic.