Sephora
10-31-2020, 12:02 AM
1) I looked at the tutorial here ([Only registered and activated users can see links]) and tried to login in a similar way but I discovered all HTTP requests are blocked by StackPath. Is it possible to bypass StackPath and log in to Neopets via HTTP request? If anyone knows how to log in programmatically, could you share a snippet of code? It doesn't have to be in Python, I am willing to code in other languages.
import requests
login_url = '[Only registered and activated users can see links]'
with requests.Session() as s:
r = s.get(login_url)
print(r.content)
payload = {'destination': '[Only registered and activated users can see links]',
'username': 'username_here', 'password': 'password_here'}
r = s.post(login_url, data=payload)
print(r.content)
2) I also attempted to login through a GreaseMonkey userscript but I got the 'No username found! Please go back and re-enter your username' page. I'm confused since I think I'm providing it with the right parameters.
$.post( "[Only registered and activated users can see links]", {username:'username_here', password:'password_here', destination: 'neopets.com/index.phtml'},
function( data ) {
$( ".result" ).html( data );
alert(data);
});
I tried it like this as well but got the same thing
$.ajax({
url: '[Only registered and activated users can see links]',
type: 'POST',
data: jQuery.param({username:'username_here', password:'password_here'}) ,
contentType: 'application/x-[Only registered and activated users can see links] charset=UTF-8',
success: function (response) {
alert(response);
},
error: function () {
alert("error");
}
});
3) Lastly, I had the userscript go to the login page ([Only registered and activated users can see links]), auto-fill the username and password, but I could not get the script to hit the green 'Login' button.
$('input[name=username').val('username_here');
$('input[name=password').val('password_here');
//None of these clicked the sign in button:
//$("input.submit[name = 'welcomeLoginButton']").submit();
//$("input.submit[name = 'welcomeLoginButton']").click();
//$('body').on('click','welcomeLoginButton',function (){alert('logged in?');});
//new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable( By.cssSelector("input.submit[name = 'welcomeLoginButton']"))).click();
//
I would love if someone could share a solution to any of these three questions. Ideally, I would like to know how to login through both GreaseMonkey userscripts and an IDE.
import requests
login_url = '[Only registered and activated users can see links]'
with requests.Session() as s:
r = s.get(login_url)
print(r.content)
payload = {'destination': '[Only registered and activated users can see links]',
'username': 'username_here', 'password': 'password_here'}
r = s.post(login_url, data=payload)
print(r.content)
2) I also attempted to login through a GreaseMonkey userscript but I got the 'No username found! Please go back and re-enter your username' page. I'm confused since I think I'm providing it with the right parameters.
$.post( "[Only registered and activated users can see links]", {username:'username_here', password:'password_here', destination: 'neopets.com/index.phtml'},
function( data ) {
$( ".result" ).html( data );
alert(data);
});
I tried it like this as well but got the same thing
$.ajax({
url: '[Only registered and activated users can see links]',
type: 'POST',
data: jQuery.param({username:'username_here', password:'password_here'}) ,
contentType: 'application/x-[Only registered and activated users can see links] charset=UTF-8',
success: function (response) {
alert(response);
},
error: function () {
alert("error");
}
});
3) Lastly, I had the userscript go to the login page ([Only registered and activated users can see links]), auto-fill the username and password, but I could not get the script to hit the green 'Login' button.
$('input[name=username').val('username_here');
$('input[name=password').val('password_here');
//None of these clicked the sign in button:
//$("input.submit[name = 'welcomeLoginButton']").submit();
//$("input.submit[name = 'welcomeLoginButton']").click();
//$('body').on('click','welcomeLoginButton',function (){alert('logged in?');});
//new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable( By.cssSelector("input.submit[name = 'welcomeLoginButton']"))).click();
//
I would love if someone could share a solution to any of these three questions. Ideally, I would like to know how to login through both GreaseMonkey userscripts and an IDE.