Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

split text with no newline

$
0
0

Hi,

I am using invoke-webRequest to a HTML page (intern) to get the innertext. It works fine but when i do a foreach to read line by line, it gave me all the Innertext as output. As far i as i can see is that all the innerText is just "one" big text.

seeing the source code of the page in chrome by pressing F12 i can see that <h3> starts with a "

 

</pre><h3>Master</h3"TEXT TEXT TEXTTEXT TEXT TEXTTEXT TEXT TEXTTEXT TEXT TEXTTEXT TEXT TEXTTEXT TEXT TEXTTEXT TEXT TEXT"</pre>

Is there anyway i can break down that "one" big text?

 

 

 

$r = Invoke-WebRequest -URI $uri$lines = $r.ParsedHtml.body.innerText foreach ($linein$lines)
        {$line
        }

Viewing all articles
Browse latest Browse all 6937

Trending Articles