I am trying to scrape a website using BeautifulSoup. The website requires a login. 

<https://www.bahn.de/p/view/meinebahn/login.shtml>

Researching the web I understand that one proper way to get authorization is using `requests`. 

My code looks as follows:

```
url = 'https://www.bahn.de/p/view/meinebahn/login.shtml'
header = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5)AppleWebKit 537.36 (KHTML, like Gecko)     Chrome","Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp    ,*/*;q=0.8"}

user = "username"
pwrd = "password"

response = requests.post(url,headers = header, auth=(user, pwrd))
page = requests.get('https://fahrkarten.bahn.de/privatkunde/meinebahn/meine_bahn_portal.go?lang=de&country=DEU#stay')

soup = BeautifulSoup(page.text, 'html.parser')

```

This does not work unfortunately as `soup` is an html text stating amongst others "You are logged out of our system". Although the result of `response` is `<Response [200]>`

I am a bit struggling with `auth`for two reasons:

1. is my understanding of the auth method even correct, i.e. first post the login details and then get access to a website which is "behind" the login) or does this work differently?
2. how do I find out if a website requires a more special auth method? Are there keywords to look for in the html code?

Any help would be appreciated as I really want to understand it and I am apparently to "newbie" to get the right conclusions from the manuals (e.g. <http://docs.python-requests.org/en/master/user/authentication/>)