Commits

Jimmy Mabey committed c4357b7

Add support for Beautiful Soup 4

Comments (0)

Files changed (1)

         try:
             from BeautifulSoup import BeautifulSoup
         except ImportError:
-            raise ImportError(
-                "You must have BeautifulSoup installed to use response.html")
+            try:
+                from bs4 import BeautifulSoup
+            except ImportError:
+                raise ImportError(
+                    "You must have BeautifulSoup installed to use "
+                    "response.html")
         soup = BeautifulSoup(self.testbody)
         return soup