Pandora Log in

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
forsakensun12
Posts: 3
Joined: Wed Apr 23, 2014 4:56 pm

Pandora Log in

Post by forsakensun12 » Wed Apr 23, 2014 5:02 pm

Hello im trying to write this code to log into pandora automatically. but i cant figure out how to get the code to hit the log in button. Ill attach the code that i have. Ive looked at different forums and tried what was said in them but it doesnt work for mine. Any input id appreciate it!


#Pandora log in info

$email = "xxxxxx@gmail.com";
$Password = "xxxxx";
$url = "http://www.pandora.com/account/sign-in"

# Create an ie com object
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate($url);

# Wait for page to load
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 10000;
}

#login
Write-Host -ForegroundColor Green "Attempting to login to Pandora.";

# Add login details
$ie.Document.getElementById("email").value = $email;
$ie.Document.getElementById("password").value = $Password;

# Click the submit button
$ie.document.getElementById("sign in").click;


# Wait for the page to load while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 30000;
}

User avatar
jvierra
Posts: 13736
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Pandora Log in

Post by jvierra » Wed Apr 23, 2014 5:17 pm

I fixed a few things and threw out some distractions.
PowerShell Code
Double-click the code block to select all.
#Pandora log in info
$email = "xxxxxx@gmail.com";
$Password = "xxxxx";
$url = "http://www.pandora.com/account/sign-in"

# Create an ie com object 
$ie = New-Object -com internetexplorer.application
$ie.visible=$true
$ie.navigate($url)
while($ie.Busy){Sleep 1} # Wait for page to load

Write-Host 'Attempting to login to Pandora.' -fore green

# Add login details 
$ie.Document.getElementById("email").value=$email 
$ie.Document.getElementById("password").value=$Password 
$ie.document.getElementById("sign in").click

while($ie.Busy){Sleep 1}
This technique will nor work on most websites.

User avatar
StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

Re: Pandora Log in

Post by StupidSexyFlanders » Wed Apr 23, 2014 5:35 pm

Works perfectly. Only thing I would recommend to the OP is to replace the 'http' with 'https' in the $url variable, just to avoid sending the newly created credentials unencrypted. Seems to work either way though :)
Mike

User avatar
forsakensun12
Posts: 3
Joined: Wed Apr 23, 2014 4:56 pm

Re: Pandora Log in

Post by forsakensun12 » Wed Apr 23, 2014 7:00 pm

StupidSexyFlanders wrote:Works perfectly. Only thing I would recommend to the OP is to replace the 'http' with 'https' in the $url variable, just to avoid sending the newly created credentials unencrypted. Seems to work either way though :)

Ughhh i dont get why it still wont work for me!

User avatar
jvierra
Posts: 13736
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Pandora Log in

Post by jvierra » Wed Apr 23, 2014 7:35 pm

It won't work if your gmail account is set to retain logins.

User avatar
jvierra
Posts: 13736
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Pandora Log in

Post by jvierra » Wed Apr 23, 2014 7:52 pm

Nope - the page has been obfuscated so you cannot auto login this way.

User avatar
forsakensun12
Posts: 3
Joined: Wed Apr 23, 2014 4:56 pm

Re: Pandora Log in

Post by forsakensun12 » Thu Apr 24, 2014 4:58 am

jvierra wrote:Nope - the page has been obfuscated so you cannot auto login this way.
Ok thanks for your help i appreciate it!

Locked