I'm trying to do something like this to parse a homepage with a login page but Invoke-WebRequest
doesn't return anything.
The page I'm trying to access is https://www.suidoapp.waterworks.metro.tokyo.lg.jp/#/login and the code I'm running is this:
$TopURI = "https://www.suidoapp.waterworks.metro.tokyo.lg.jp/#/login"
$TopPage = Invoke-WebRequest -Method Get -Uri $TopURI -SessionVariable MySession -UseBasicParsing
When I look at the Content or RawContent of the $TopPage
I can see that it just says "please enable JavaScript" (I've tried both with and without -UseBasicParsing
). If I open the page in developer tool in my browser I can see that response for the initial document is the same:
But the interesting thing is that even though the initial page says "please enable JavaScript" the page actually loads:
Has anyone seen this before, where Invoke-WebRequest
fails because the response is "please enable JavaScript" yet the page should actually be able to load? Is there another way for me to parse a homepage and send in login forms when Invoke-WebRequest
fails like this?