title: Python: Scraping the most common words on the front page of the New York Times
body: <p>I can't seem to get my code to run.  I haven't seen anyone with the same error code.  Calling people smarter than me, any ideas?</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  from collections import Counter
  from string import punctuation
  
  r = requests.get("https://www.nytimes.com/?mcubz=0")
  
  soup = BeautifulSoup(r.content, "lxml")
  
  text = (''.join(s.findAll(text=True))for s in soup.findAll('p'))
  
  c = Counter((x.rstrip(punctuation).lower() for y in text for x in y.split()))
  
  print (c.most_common())
  </code></pre>
  
  <p>Here is my error message</p>
  
  <pre><code>Traceback (most recent call last):
    File "ScrapeNews.py", line 19, in &lt;module&gt;
      print (c)
    File "C:\Users\Antra\Desktop\Python\lib\encodings\cp437.py", line 19, in encode
      return codecs.charmap_encode(input,self.errors,encoding_map)[0]
  UnicodeEncodeError: 'charmap' codec can't encode character '\u2014' in position 218: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>I'm flummoxed. </p>