How to get the (full) content of a webpage by Powershell

Eddy De Maerschalck 0 Reputation points
2023-06-21T13:03:37.4366667+00:00

I'm trying to look at the content of a dynamically written webpage (by a supplier). As it takes sometimes for that supplier a long time to get all the data and write the webpage, my powershell instructions to consult that page doesn't have all the data.

How can I use the instruction invoke-webrequest to wait long enough to get all the data.

For example

$from = "2023-07-10"

$until = "2023-07-17"

$url = "https://www.europarcs.nl/zoek/verblijven?resort=DP800&startdate=" + $from + "&enddate=" + $until + "&subjects=114106,2"

$url

$r = invoke-webrequest -uri $url

$r.content.contains('Cube')

gives me now the result false even when i see visually the word Cube on the screen when i look at the page https://www.europarcs.nl/zoek/verblijven?resort=DP800&startdate=2023-07-10&enddate=2023-07-17&subjects=114106,2 in google chrome webbrowser

(Attention, $from en $until has to be in the future (and mostly the best result is when you use a monday and a friday).

I have also experiment with the InternetExplorer.Application object, but there i had also the same problem. I'v use the properties busy and readystate to build in some delay, but the same problem.

Thanks in advance for any idea's.

Eddy

Windows for business | Windows Server | User experience | PowerShell
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,906 Reputation points
    2023-06-21T19:42:05.3733333+00:00

    The content you want doesn't exist in the data you received from the URL. What you see is generated by scripts within that data that run to produce the web page you see.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.