title: How to use multiprocessing with requests module?
body: <p>I am new dev in python. My code is code below:</p>
  
  <pre><code>import warnings
  import requests
  import multiprocessing
  
  from colorama import init
  init(autoreset=True)
  
  from requests.packages.urllib3.exceptions import InsecureRequestWarning
  warnings.simplefilter("ignore", UserWarning)
  warnings.simplefilter('ignore', InsecureRequestWarning)
  
  from bs4 import BeautifulSoup as BS
  
  headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
  
  
  class Worker(multiprocessing.Process):
  
      def run(self):
          with open('ips.txt', 'r') as urls:
              for url in urls.readlines():
                  req = url.strip()
                  try:
                      page = requests.get(req, headers=headers, verify=False, allow_redirects=False, stream=True,
                                          timeout=10)
                      soup = BS(page.text)
                      # string = string.encode('ascii', 'ignore')
                      print('\033[32m' + req + ' - Title: ', soup.title)
                  except requests.RequestException as e:
                      print('\033[32m' + req + ' - TimeOut!')
          return
  
  
  if __name__ == '__main__':
      jobs = []
      for i in range(5):
          p = Worker()
          jobs.append(p)
          p.start()
      for j in jobs:
          j.join()
  </code></pre>
  
  <p>I am trying to make the program read <code>IPs.txt</code> and print out the title of each website.</p>
  
  <p>It works flawlessly in a single thread. Now I want to make it faster by using <code>multiprocessing</code>.</p>
  
  <p>But it just outputs the same line 5 times for some reason. I am new with multiprocessing and tried my best with failed attempts.</p>
  
  <p>Screen shot showing problem:</p>
  
  <p><a href="https://i.stack.imgur.com/ftxUx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ftxUx.png" alt="screen shot showing problem"></a></p>
  
  <p>I just want to run 5 workers to check the <code>IPs.txt</code> in multithreading or parallel...I just want to make it faster.</p>
  
  <p>Any hint, clue, help?</p>