Page 1 of 1

Pandora Log in

Posted: Wed Apr 23, 2014 5:02 pm
by forsakensun12
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;
}

Re: Pandora Log in

Posted: Wed Apr 23, 2014 5:17 pm
by jvierra
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.

Re: Pandora Log in

Posted: Wed Apr 23, 2014 5:35 pm
by StupidSexyFlanders
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 :)

Re: Pandora Log in

Posted: Wed Apr 23, 2014 7:00 pm
by forsakensun12
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!

Re: Pandora Log in

Posted: Wed Apr 23, 2014 7:35 pm
by jvierra
It won't work if your gmail account is set to retain logins.

Re: Pandora Log in

Posted: Wed Apr 23, 2014 7:52 pm
by jvierra
Nope - the page has been obfuscated so you cannot auto login this way.

Re: Pandora Log in

Posted: Thu Apr 24, 2014 4:58 am
by forsakensun12
jvierra wrote:Nope - the page has been obfuscated so you cannot auto login this way.
Ok thanks for your help i appreciate it!