0

I would like to acces on my neteller account by Invoke-WebRequest .

I have found the fields to be filled

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

I have tried this code things .

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

with password and loggin inside of the file but same issue.

I would like to get the page after the login is done .

lol lol
  • 71
  • 6
  • Please clarify this … "I would like to get the page after the login is done ." … So, you provide user name, password and then execute the click event on the 'Sign in' button (code you are not showing btw for either the request or the submit). Yet, in a quick attempt to scrape the page for form elements to use, automation, due to the way they the site coded, is blocked / hindered. So, that would mean you need to rethink this effort. – postanote Apr 26 '19 at 05:08
  • yes a I provide username and password ..... " then execute the click event on the 'Sign in' button (code you are not showing btw for either the request or the submit) "....How can i get the button event and how to use it ? – lol lol Apr 26 '19 at 07:22
  • I have found this and the event is this https://member.neteller.com/assets/header-2a622cfcc704047029c44a8fb9a58002.js – lol lol Apr 26 '19 at 07:32
  • See my update for you. – postanote Apr 26 '19 at 23:14

1 Answers1

0

Moving from the comment section to be more specific for the OP.

As for your comments...

How can i get the button event and how to use it ?

I have found this

input type="submit" name="btn-login" class="button radius" value="Sign in" id="btn-login"

There are several ways, but again, the site, the way it is coded, actually prevents some automation actions. So, my point is, it appears that they do not want folks using automation at / on their site.

Clicking buttons, links and the like, require the browser UI be visible. You seem to be wanting to do this non-visible, but I could be wrong.

All things considered, there are a few ways to get to click. Totally dependent on the site designers and what they made available to act on. Here are a few examples from sites, I've had to deal with, single and multi-page/form sites, that allowed automation.

# 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

Here is a full example of what I mean.

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()
postanote
  • 15,138
  • 2
  • 14
  • 25
  • Hello , I used the second options who are IE . It's more easy for me to do it by that way because I can see ..... Invoke-WebRequest ("https://portal.concordfax.com/Account/LogOn" + $R.ParsedHtml.getElementsByClassName("blueButton login").click I haven't imagined that this option was possible (click event with webrequest ) ...Can you explain why is IHTMLDocument3 and not IHTMLDocument4 or another number ?....How can I know that the login page is document3 or 5 or 1 ?Thx . – lol lol Apr 27 '19 at 07:56