Pandora Log in

Ask your 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.
This topic is 9 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
forsakensun12
Posts: 3
Last visit: Thu Apr 24, 2014 11:35 am

Pandora Log in

Post 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;
}
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Pandora Log in

Post 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.
StupidSexyFlanders
Posts: 107
Last visit: Thu Apr 29, 2021 8:47 am

Re: Pandora Log in

Post 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 :)
Mike
User avatar
forsakensun12
Posts: 3
Last visit: Thu Apr 24, 2014 11:35 am

Re: Pandora Log in

Post 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!
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Pandora Log in

Post by jvierra »

It won't work if your gmail account is set to retain logins.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Pandora Log in

Post by jvierra »

Nope - the page has been obfuscated so you cannot auto login this way.
User avatar
forsakensun12
Posts: 3
Last visit: Thu Apr 24, 2014 11:35 am

Re: Pandora Log in

Post 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!
This topic is 9 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked