title: NameError: name 'argparse' is not defined
body: <p>I am using python 3.7.4, here is my code but it doesn't work. It's a ssrf scanner wrote by python, I just started to learning 'argparse' so don't know what wrong in the code:</p>
  
  <pre><code>import sys
  import argparse
  
  error = "Please enter a valid command. If you don't know how to use, enter '--help'"
  parser = argparse.ArgumentParser(version='1.0')
  parser.add_argument('-u', help='URL', dest='url')
  parser.add_argument('--get', help='Method GET', dest='get')
  parser.add_argument('--post', help='Method POST', dest='post')
  parser.add_argument('-i', help='Ip', dest='ip')
  parser.add_argument('-p', help='Port', dest='port')
  parser.add_argument('-d', help='Post data', dest='param')
  parser.add_argument('--encode', help='Encode payloads', dest='encode')
  parser.add_argument('--proxy', help='Use proxy(y|ies)',
                      dest='proxy', action='store_true')
  parser.add_argument('-f', help='Load payloads from a file', dest='file')
  parser.add_argument('-h', help='Add headers',
                      dest='header', const=True)
  parser.add_argument('--white', help='Whitelist', dest='wlist')
  parser.add_argument('--black', help='Blacklist', dest='blist')
  
  url = args.url
  get = args.get
  post = args.post
  ip = args.ip
  port = args.port
  param = args.param
  encode = args.encode
  proxy = args.proxy
  file = args.file
  header = args.header
  wlist = args.wlist
  blist = args.blist
  
  if not url:
      print(error)
      quit()
  
  if not "http://" in url or "https://" in url:
      print("Please enter full URL(Include 'https://' or 'http://)")
      quit()
  
  if not get and post:
      print(error)
      quit()
  
  if post:
      if not param:
          print(error)
          quit()
  
  from mode import scan        
  from mode import test
  </code></pre>
  
  <p>Even I have import 'argparse', an error still appear:</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:\SSdom\ssrf.py", line 7, in &lt;module&gt;
      parser = argparse.ArgumentParser(version='1.0')
  NameError: name 'argparse' is not defined
  </code></pre>
  
  <p>Can anyone help me, please! (Sorry if this is a stupid question)</p>