如何通过Invoke-WebRequest访问neteller帐户

问题描述 投票:0回答:1

我想通过Invoke-WebRequest访问我的neteller帐户。

我找到了要填补的字段

<input type="password" name="password" id="form-login-password" maxlength="32" placeholder="Password" autocomplete="off" pattern=".*" required="" value="Welcome 123">

我试过这个代码的东西。

$content=Get-Content "$home\Downloads\test log\NETELLER » Signin.html"
$qw=Invoke-WebRequest https://member.neteller.com -Method Post -Body $content -SessionVariable test

使用密码和记录文件,但同样的问题。

我想在登录完成后获取该页面。

powershell webrequest neteller
1个回答
0
投票

从评论部分移动到更具体的OP。

至于你的评论......

我怎样才能获得按钮事件以及如何使用它?

我找到了这个

input type =“submit”name =“btn-login”class =“button radius”value =“登录”id =“btn-login”

有几种方法,但同样,网站,它的编码方式,实际上阻止了一些自动化操作。所以,我的观点是,他们似乎不希望人们在他们的网站上/在他们的网站上使用自动化。

单击按钮,链接等,需要浏览器UI可见。你似乎想要做到这一点不可见,但我可能是错的。

考虑到所有事情,有几种方法可以点击。完全依赖于网站设计师以及他们可以采取的行动。以下是网站的一些示例,我必须处理,单页和多页/表单站点,允许自动化。

# Starting here...
$ie.Document.getElementsByName('commit').Item().Click();

# Or
$ie.document.IHTMLDocument3_getElementsByTagName("button") | 
ForEach-Object { $_.Click() }

# Or
($ie.Document.IHTMLDocument3_getElementsByTagName('button') | 
Where-Object innerText -eq 'SIGN IN').Click()

# Or
($ie.document.getElementById('submitButton') | 
select -first 1).click()

# Or ...
$Link=$ie.Document.getElementsByTagName("input") | 
where-object {$_.type -eq "button"}
$Link.click()

# Or ...
$Submit = $ie.document.getElementsByTagName('INPUT') | 
Where-Object {$($_.Value) -match 'Zaloguj'}
$Submit.click()

# Or
$ie.Document.getElementById("next").Click()

# Or
$SubmitButton=$Doc.IHTMLDocument3_getElementById('button') | 
Where-Object {$_.class -eq 'btn btn-primary'}
$SubmitButton.Click()

# Or
Invoke-WebRequest ("https://portal.concordfax.com/Account/LogOn" + 
$R.ParsedHtml.getElementsByClassName("blueButton login").click

这是我的意思的完整例子。

Scrape the site for object info.

$url = 'https://pwpush.com'
($FormElements = Invoke-WebRequest -Uri $url -SessionVariable fe)  
($Form = $FormElements.Forms[0]) | Format-List -Force
$Form | Get-Member
$Form.Fields

Use the info on the site

$IE = New-Object -ComObject "InternetExplorer.Application"

$FormElementsequestURI = "https://pwpush.com"
$Password = "password_payload"
$SubmitButton = "submit"

$IE.Visible = $true
$IE.Silent = $true
$IE.Navigate($FormElementsequestURI)
While ($IE.Busy) {
    Start-Sleep -Milliseconds 100
}

$Doc = $IE.Document
$Doc.getElementsByTagName("input") | ForEach-Object {
    if ($_.id -ne $null){
        if ($_.id.contains($SubmitButton)) {$SubmitButton = $_}
        if ($_.id.contains($Password)) {$Password = $_}
    }
}

$Password.value = "1234"
$SubmitButton.click()
© www.soinside.com 2019 - 2024. All rights reserved.