Commits

Jimmy Mabey  committed c4357b7

Add support for Beautiful Soup 4

  • Participants
  • Parent commits 7bfa117
  • Branches beautifulsoup4-support

Comments (0)

Files changed (1)

File webtest/app.py

         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