title: How to fix ' raise ValueError("unknown url type: %r" % self.full_url) ValueError: unknown url type: '''
body: <p>So I have been following along some videos to learn python, but can't get rid of this error. I have experience in other languages so I'm usually fine to fix errors, but no matter what I do, I either get the same error or something different. </p>
  
  <p>I've tried switching the argument from 'xml' to 'lxml', but this only changes the error that I get</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import urllib.request
  
  
  
  req = urllib.request.urlopen('http://pythonprogramming.net/')
  
  
  xml = BeautifulSoup(req, 'xml')
  
  for item in xml.findAll('link'):
      url = item.text
      news = urllib.request.urlopen(url).read()
      print(news)
  </code></pre>
  
  <p>Ideally, this would print out some of the text within link tags, but instead, I get the following errors - </p>
  
  <p>Error while using xml - </p>
  
  <pre><code>  File "/Users/rodrigo/Desktop/ALL/Programming/Python/Python Web Programming/Working with HTML/scrapingParagraphData.py", line 13, in &lt;module&gt;
      news = urllib.request.urlopen(url).read()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
      return opener.open(url, data, timeout)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 525, in open
      response = self._open(req, data)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 548, in _open
      'unknown_open', req)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
      result = func(*args)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1387, in unknown_open
      raise URLError('unknown url type: %s' % type)
  urllib.error.URLError: &lt;urlopen error unknown url type: @media (min-width&gt;
  </code></pre>
  
  <p>Error while using lxml - </p>
  
  <pre><code>  File "/Users/rodrigo/Desktop/ALL/Programming/Python/Python Web Programming/Working with HTML/scrapingParagraphData.py", line 13, in &lt;module&gt;
      news = urllib.request.urlopen(url).read()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
      return opener.open(url, data, timeout)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 510, in open
      req = Request(fullurl, data)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 328, in __init__
      self.full_url = url
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 354, in full_url
      self._parse()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 383, in _parse
      raise ValueError("unknown url type: %r" % self.full_url)
  ValueError: unknown url type: ''
  </code></pre>