title: Requests and multiprocessing
body: <p>So i'm trying to use <code>requests</code> and <code>BeautifulSoup</code> on several websites in the same time and for some reason i can't make it work.
  Here is a full example:</p>
  
  <pre><code>import multiprocessing as mp
  import requests
  from bs4 import BeautifulSoup
  from random import randint
  
  # Define an output queue
  
  
  class Spider(object):
      """docstring for Spider"""
      def __init__(self):
          super(Spider, self).__init__()
  
      # define a example function
      def rand_string(length, output):
          random_post=randint(1000000,9999999)
          response=requests.get('https://stackoverflow.com/questions/'+str(random_post))
          soup=BeautifulSoup(response.content,'lxml')
          try:
              title=soup.find('a',{'class':'question-hyperlink'}).string
          except:
              title="not found"
  
          output.put(title)
  
      # Setup a list of processes that we want to run
      def run(self):
  
          output = mp.Queue()
          processes = [mp.Process(target=Spider.rand_string, args=(x, output)) for x in range(10)]
  
          for p in processes:
              p.start()
  
          # Exit the completed processes
  
          for p in processes:
              p.join()
  
          # Get process results from the output queue
  
          results = [output.get() for p in processes]
          print(results)
  
  # Run processes
  
  if __name__ == '__main__':
  
      spider=Spider()
      spider.run()
  </code></pre>