diff --git a/selector.go b/selector.go
index <HASH>..<HASH> 100644
--- a/selector.go
+++ b/selector.go
@@ -466,10 +466,13 @@ func siblingSelector(s1, s2 Selector, adjacent bool) Selector {
 		}
 
 		if adjacent {
-			if n.PrevSibling == nil {
-				return false
+			for n = n.PrevSibling; n != nil; n = n.PrevSibling {
+				if n.Type == html.TextNode || n.Type == html.CommentNode {
+					continue
+				}
+				return s1(n)
 			}
-			return s1(n.PrevSibling)
+			return false
 		}
 
 		// Walk backwards looking for element that matches s1
diff --git a/selector_test.go b/selector_test.go
index <HASH>..<HASH> 100644
--- a/selector_test.go
+++ b/selector_test.go
@@ -321,7 +321,9 @@ var selectorTests = []selectorTest{
 		},
 	},
 	{
-		`<p id="1"><p id="2"></p><address></address><p id="3">`,
+		`<p id="1"></p>
+		 <!--comment-->
+		 <p id="2"></p><address></address><p id="3">`,
 		`p + p`,
 		[]string{
 			`<p id="2">`,
fix: adjacent sibling selector should ignore text node and comment node