Added encode method into web.py and used bs4.BeautifulSoup instead BeautifulSoup.BeautifulSoup