diff --git a/src/Parse.js b/src/Parse.js
index <HASH>..<HASH> 100644
--- a/src/Parse.js
+++ b/src/Parse.js
@@ -77,6 +77,9 @@ _html2canvas.Parse = function (images, options, cb) {
       for (i = 0, j = classes.length; i < j; i++) {
         classes[i] = classes[i].match(/(^[^:]*)/)[1];
       }
+      
+      // remove empty values, if not could cause invalid selectors with querySelectorAll
+      classes = classes.filter(function (n) { return n });
     }
 
     // Using the list of elements we know how pseudo el styles, create fake pseudo elements.
@@ -1273,4 +1276,4 @@ _html2canvas.Parse = function (images, options, cb) {
       }
     }
   }
-};
\ No newline at end of file
+};
Fix invalid selector exception with empty class values

After removing :before and :after pseudo selectors, a class name may be empty, causing an invalid selector string when joined. Remove empty elements before calling querySelectorAll.