1

I need to log on site, and parse info. I am trying to do this: powershell invoke-webrequest to log into website But I can not find the form... If I use function view page source in the browser I see only:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#ffffff"><link rel="icon" href="/frontend/favicon.ico">
<link href="/frontend/css/99.ad9d8c.css" rel="stylesheet"><link href="/frontend/css/style.aa5ad6.css" rel="stylesheet">
</head>
<body>
<div id="content"></div>
<script src="/frontend/js/modules/vendors~index.ad9d8c.chunk.js"></script>
<script src="/frontend/js/index.275be7.bundle.js"></script>
</body>
</html>

Update I am try next, but this not work for me.

$ieObject = New-Object -ComObject 'InternetExplorer.Application'
$ieObject.Navigate('http://XXX.XXX.XXX.XXX:8090/frontend/login')
$currentDocument = $ieObject.Document
$currentDocument.IHTMLDocument3_getElementsByTagName("input") | Select-Object Type,Name

Error

 You cannot call a method on a null-valued expression. 
2
  • 1
    Powershell web automation is usually done with Selenium, in my experience. Here is a reasonably good tutorial, though I haven't use Selenium myself in several years (I've nothing to automate): adamtheautomator.com/… Commented Jan 2, 2021 at 11:55
  • @Tomalak I tried this, but it didn’t work for me gngrninja.com/script-ninja/2016/9/25/…, maybe your now other method? Commented Jan 7, 2021 at 8:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.