title: How to get around "MissingSchema" error in Python?
body: <p>After running my script I notice that my "parse_doc" function throws error when it find's any url None. Turn out that, my "process_doc" function were supposed to produce 25 links but it produces only 19 because few pages doesn't have any link to lead to another page. However, when my second function receives that link with None value, it produces that error indicating "MissingSchema". How to get around this so that when it finds any link with None value it will go for another. Here is the partial portion of my script which will give you an idea what I meant:</p>
  
  <pre><code>def process_doc(medium_link):
  
      page = requests.get(medium_link).text
      tree = html.fromstring(page)
      try:
          name = tree.xpath('//span[@id="titletextonly"]/text()')[0]
      except IndexError:
          name = ""
      try:
          link = base + tree.xpath('//section[@id="postingbody"]//a[@class="showcontact"]/@href')[0]
      except IndexError:
          link = ""
  
      parse_doc(name, link)   "All links get to this function whereas some links are with None value
  
  def parse_doc(title, target_link):
      page = requests.get(target_link).text   # Error thrown here when it finds any link with None value
  
      tel = re.findall(r'\d{10}', page)[0] if re.findall(r'\d{10}', page) else ""
      print(title, tel)
  </code></pre>
  
  <p>The error what I'm getting:</p>
  
  <pre><code>raise MissingSchema(error)
  requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?
  </code></pre>
  
  <p>Btw, in my first function there is a variable named "base" which is for concatenating with the produced result to make a full-fledged link.</p>