File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,32 @@ public void testExtractHtml() throws Exception {
5959 "<th>website</th>" , title );
6060 }
6161
62+ @ Test
63+ public void testExtractHtmlEq () throws Exception {
64+ selectorExtractor = new SelectorExtractor ("tr" , 1 , "html" );
65+ String title = selectorExtractor .extract (html );
66+ Assert .assertEquals ("<th>type</th> \n " +
67+ "<th>name</th> \n " +
68+ "<th>website</th>" , title );
69+ }
70+
71+ @ Test
72+ public void testExtractTextEq () throws Exception {
73+ selectorExtractor = new SelectorExtractor ("tr" , 1 , "text" );
74+ String title = selectorExtractor .extract (html );
75+ Assert .assertEquals ("type name website" , title );
76+ selectorExtractor = new SelectorExtractor ("tr" , 1 );
77+ title = selectorExtractor .extract (html );
78+ Assert .assertEquals ("type name website" , title );
79+ }
80+
81+ @ Test
82+ public void testExtractText () throws Exception {
83+ selectorExtractor = new SelectorExtractor ("tr:nth-child(2).text" );
84+ String title = selectorExtractor .extract (html );
85+ Assert .assertEquals ("type name website" , title );
86+ }
87+
6288 @ Test
6389 public void testExtractList () throws Exception {
6490 selectorExtractor = new SelectorExtractor ("tr:has(td)" );
You can’t perform that action at this time.
0 commit comments