title: Login and access pages of a website using python
body: <p>So I'm trying to write some code that goes to a website (an internal confluence wiki) and retrieves specific html pages.  I have the part of the code that decodes the html with BeautifulSoup working, however I've hit a road block because it requires a log in before I can access the pages.  I've tried using requests and urllib with no success.  Also I'm using Python 3.4.  </p>
  
  <pre><code>def log():
      URL = 'confluence page here'
      EMAIL = '****'
      PASSWORD = '****'
  
      # Start a session so we can have persistant cookies
      session = requests.session(config={'verbose': sys.stderr})
  
      # This is the form data that the page sends when logging in
      login_data = {
          'loginemail': EMAIL,
          'loginpswd': PASSWORD,
          'submit': 'login',
      }
  
      # Authenticate
      r = session.post(URL, data=login_data)
  
      # Try accessing a page that requires you to be logged in
      r = session.get(page i want to access)
      return r
  </code></pre>
  
  <p>However I get an error <code>TypeError: session() got an unexpected keyword argument 'config'</code>.  Does anyone know a way to login to confluence wiki then grab the html source of an arbitrary number of pages?  I would prefer to avoid using any unsupported packages.</p>