title: Regex & BeautifulSoup - TypeError: expected string or bytes-like object
body: <p>My code is running into some unexpedt error. Tried to tweak with have 'u' instead of 'r', but still get same error. Tried other solutions from stacks, but didn't go anywhere. Any suggestion? </p>
  
  <pre><code>#use urlib and beautifulsoup to scrpe table 
  
  from urllib.request import urlopen
  from bs4 import BeautifulSoup
  import re
  import pandas as pd
  
  url = 'https://www.example.com/profiles'
  
  page = urlopen(url).read()
  soup = BeautifulSoup(page, 'lxml')
  #print(soup)
  
  reEngName = re.compile(r'\[\*\*.+\*\*\]')
  reKorName = re.compile(r'\([^\/h]*\)')
  reProfile = re.compile(r'\|.+')
  
  for line in re.findall(reEngName, soup):
      print(line)
  </code></pre>
  
  <p>Error message: </p>
  
  <pre><code>Traceback (most recent call last):
    File "ckurllib.py", line 18, in &lt;module&gt;
      for line in re.findall(reEngName, soup):
    File "C:\Users\Sammy\Anaconda3\lib\re.py", line 222, in findall
      return _compile(pattern, flags).findall(string)
  TypeError: expected string or bytes-like object
  </code></pre>