0

I am trying to get some acsii art characters directly from a webpage. You can navigate to the page using the following URL.

http://patorjk.com/software/taag/#p=display&f=Acrobatic&t=A

If you go to that page you will see a rendering of the character A using the Acrobatic font.

         o         
        <|>        
        / \        
      o/   \o      
     <|__ __|>     
     /       \     
   o/         \o   
  /v           v\  
 />             <\

Using the following code nets me most of the page.

$fontUrlTemplate = "http://patorjk.com/software/taag/#p=display&f={0}&t={1}"
$fontName = [uri]::EscapeUriString("Acrobatic")
$character = "A"

$fontUrl = $fontUrlTemplate -f $fontName, $character
$webResult = Invoke-WebRequest $fontUrl 
$webResult.Content

However when I inspect the Content the actual result I am looking for is missing.

...
<div id="maincontent" >
    <div id="outputFigDisplay" ></div>
</div>
...

There should be something like this in there

<pre id="taag_output_text" style="float:left;" class="fig" contenteditable="true">...</pre>

I am sure there is a server side reason for this but I would like to better understand and, if possible, mitigate it. I have tried mucking around with -ContentType and -UserAgent but it didn't change anything

Matt
  • 45,022
  • 8
  • 78
  • 119
  • That's because the contents in the `outputFigDisplay` div are calculated and painted after the page has loaded by [a piece of javascript](http://patorjk.com/software/taag/js/main.js?2017.01.01) in your browser – Mathias R. Jessen Jan 29 '19 at 17:34
  • 1
    @MathiasR.Jessen Thanks. So I guess then I cannot do it this way.. IE Com object maybe... even though that sounds horrible. – Matt Jan 29 '19 at 18:37
  • 1
    Which means I found a dupe for this... – Matt Jan 29 '19 at 18:49

0 Answers0