title: Python_MySQL: AttributeError: 'function' object has no attribute 'translate'
body: <p>When running the following code python code I get the following code:</p>
  
  <pre><code>from urllib.request import urlopen
  from bs4 import BeautifulSoup
  import datetime
  import random
  import pymysql
  import re
  
  conn = pymysql.connect(host='127.0.0.1', user='root', passwd ='mypass', 
  db='mysql',charset='utf8')
  
  cur = conn.cursor()
  cur.execute('USE scraping')
  
  random.seed(datetime.datetime.now())
  
  def store(title, content):
  
      cur.execute("DROP TABLE IF EXISTS pages")
  
       sql = """CREATE TABLE pages (id BIGINT(7) NOT NULL AUTO_INCREMENT, title VARCHAR(200)
          , content VARCHAR(10000), created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(id))"""
  cur.execute(sql)
  
  cur.execute("""INSERT INTO pages (title, content) VALUES ("%s", "%s")""", (title, content))
  cur.connection.commit()
  
  def getLinks(articleUrl):
       html = urlopen('http://en.wikipedia.org'+articleUrl)
       bs = BeautifulSoup(html, 'html.parser')
       title = bs.find('h1').get_text()
       content = bs.find('div', {'id':'mw-content-text'}).find('p').get_text
       store(title, content)
       #return bs.find('div',{'id':'bodyContent'}).findAll('a',href=re.compile('^(/wiki/)((?!:).)*$'))
  
  links = getLinks('/wiki/Kevin_Bacon')
  #print(links)
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>  AttributeError: 'function' object has no attribute 'translate'
  </code></pre>
  
  <p>From what I can tell the failure point seems to be at this point in the code:</p>
  
  <pre><code>cur.execute("""INSERT INTO pages (title, content) VALUES ("%s", "%s")""", (title, content))
  </code></pre>
  
  <p>I've tried trouble shooting the issue by looking at the following:</p>
  
  <pre><code>- File "C:\Users\mypath\PycharmProjects\Scraper\venv\lib\site-packages\pymysql\converters.py", line 118, in escape_unicode
  return u"'%s'" % _escape_unicode(value)
  
  - File "C:\Users\mypath\PycharmProjects\Scraper\venv\lib\site-packages\pymysql\converters.py", line 73, in _escape_unicode
  return value.translate(_escape_table)
  </code></pre>
  
  <p>Any thoughts on what might be causing the issue?</p>