python http requests; browser not detected
Question: I want to login to my account with the following structure:

    
    
    import requests
    session=requests.Session()
    resp=session.get('https://mywebsite.com/login')
    cont=resp.content
    post_data={'user':'username', 'pass':'password'}
    post_response=session.post(url='https://mywebsite.com/login', data=post_data}
    print cont
    

The following error occurs:

**Browser Error: Your browser version looks incompatible**


Answer: Change your `User-Agent` to something that the website thinks is compatible.
You can do it like this,

    
    
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
    }
    r = session.post('https://mywebsite.com/login', data=post_data, headers=headers)
    

