title: How to scrape a website which requires login using python and beautifulsoup?
body: <p>If I want to scrape a website that requires login with password first, how can I start scraping it with python using beautifulsoup4 library? Below is what I do for websites that do not require login. </p>
  
  <pre><code>from bs4 import BeautifulSoup    
  import urllib2 
  url = urllib2.urlopen("http://www.python.org")    
  content = url.read()    
  soup = BeautifulSoup(content)
  </code></pre>
  
  <p>How should the code be changed to accommodate login? Assume that the website I want to scrape is a forum that requires login. An example is <a href="http://forum.arduino.cc/index.php">http://forum.arduino.cc/index.php</a></p>