title: Request URL and make directory error in python
body: <p>This programs runs but gives back no output.Doesn't create a new folder or download the images from URLs.</p>
  <pre><code>import urllib.request
  import cv2
  import numpy as np
  import os    
  def store_raw_images():
      neg_images_link = 'http://image-net.org/api/text/imagenet.synset.geturls?wnid=n07942152'   
      neg_image_urls = urllib.request.urlopen(neg_images_link).read().decode()
      pic_num = 1
      
      if not os.path.exists('neg'):
          os.makedirs('neg')
          
      for i in neg_image_urls.split('\n'):
          try:
              print(i)
              urllib.request.urlretrieve(i, &quot;neg/&quot;+str(pic_num)+&quot;.jpg&quot;)
              img = cv2.imread(&quot;neg/&quot;+str(pic_num)+&quot;.jpg&quot;,cv2.IMREAD_GRAYSCALE)
              # should be larger than samples / pos pic (so we can place our image on it)
              resized_image = cv2.resize(img, (100, 100))
              cv2.imwrite(&quot;neg/&quot;+str(pic_num)+&quot;.jpg&quot;,resized_image)
              pic_num += 1
              
          except Exception as e:
              print(str(e))
  store_raw_images()
  </code></pre>
  <p>what is going wrong here?</p>
  <p>i get this error when i run this in IDLE.</p>
  <pre><code>Traceback (most recent call last):
  
    File &quot;C:\Users\HP\Desktop\Training images\download_images.py&quot;, line 26, in &lt;module&gt;
      store_raw_images()
    File &quot;C:\Users\HP\Desktop\Training images\download_images.py&quot;, line 8, in store_raw_images
      neg_image_urls = urllib.request.urlopen(neg_images_link).read().decode()
    File &quot;C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\urllib\request.py&quot;, line 214, in urlopen
      return opener.open(url, data, timeout)
    File &quot;C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\urllib\request.py&quot;, line 501, in open
      req = Request(fullurl, data)
    File &quot;C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\urllib\request.py&quot;, line 320, in __init__
      self.full_url = url
    File &quot;C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\urllib\request.py&quot;, line 346, in full_url
      self._parse()
    File &quot;C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\urllib\request.py&quot;, line 375, in _parse
      raise ValueError(&quot;unknown url type: %r&quot; % self.full_url)
  ValueError: unknown url type: '//image-net.org/api/text/imagenet.synset.geturls?wnid=n07942152'
  </code></pre>