I've been trying to access a website with no API. I want to retreive my current "queue" from the website. But it won't let me access this part of the website if i'm not logged in. Here is my code :
login_data = {
'action': 'https://www.crunchyroll.com/?a=formhandler',
'name': 'my_username',
'password': 'my_password'
}
import requests
with requests.Session() as s:
s.post('https://www.crunchyroll.com/login', data=login_data)
ck = s.cookies
r = s.get('https://www.crunchyroll.com/home/queue')
print r.text
Right now, I get a page :
<html lang="en">
<head>
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0;url=http://www.crunchyroll.com/home/queue" />
</head>
<body>
<script type="text/javascript">
document.location.href="http:\/\/www.crunchyroll.com\/home\/queue";
</script>
</body>
</html>
I think it should work, but I'm only getting the redirecting page ... How am I suppose to get past that ?
Thanks !
s.get('http://www.crunchyroll.com/home/queue')instead? Since that is where you are being redirected.