Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

download webpage content credential

$
0
0

I am trying to download a webpage content after passing on the credentails. Then downloading the content to a text file
and then parsing it to fetch the desried result. I am able to get the desired result while i am doing it from ISE/PS console. But when i am scheduleing it...The output is null.

Please provide your expertise inputs.

===========

$username = "username"
$password = "password"

$ie = New-Object -com InternetExplorer.Application

$ie.visible=$true

$ie.navigate("mywebsite.com")

while($ie.ReadyState -ne 4) {start-sleep -m 100}

$ie.document.getElementById("j_username").value = "$username"

$ie.document.getElementById("j_password").value = "$password"

$ie.document.getElementById("loginform").submit()

start-sleep 20

$mmy = $ie.Document.body
$mmy | Out-File -FilePath "c:\shell\axiom.txt"
$line = Get-Content "c:\shell\axiom.txt" | Select-String "inclue" | Select-String "exclu" -NotMatch
$line

================================


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>