title: "TypeError: expected string or buffer" when filtering list with regex
body: <p>I am currently trying to apply regex in order to filter out certain links out of a list consisting of links.</p>
  
  <p>I've tried it in severals ways now but I always get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/User/Documents/pyp/pushbullet_updater/DoDa/test.py", line 20, in &lt;module&gt;
      print(get_chapter_links(links))
    File "/Users/User/Documents/pyp/pushbullet_updater/DoDa/test.py", line 15, in get_chapter_links
      match = re.findall(r"https://bluesilvertranslations\.wordpress\.com/\d{4}/\d{2}/\d{2}/douluo-dalu-\d{1,3}-\s*/", link)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/re.py", line 210, in findall
      return _compile(pattern, flags).findall(string)
  TypeError: expected string or buffer
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  import re
  
  #Gets chapter links
  def get_chapter_links(index_url):
      r = requests.get(index_url)
      soup = BeautifulSoup(r.content, 'lxml')
      links = soup.find_all('a')
      url_list = []
      for url in links:
          url_list.append((url.get('href')))
  
      for link in url_list: # Iterates through every line and looks for a match:
          match = re.findall(r"https://bluesilvertranslations\.wordpress\.com/\d{4}/\d{2}/\d{2}/douluo-dalu-\d{1,3}-\s*/", link)
      return match
  
  links = 'https://bluesilvertranslations.wordpress.com/chapter-list/'
  
  print(get_chapter_links(links))
  </code></pre>