Fix latest beautiful soup import error

Fix the latest beautiful soup import error by adding exception handling