擅长:python、mysql、java
<p>我知道我需要做什么。我需要把res列成一个列表。就这样。比我想象的简单多了。这就是现在的样子:</p>
<pre><code>class TestScrapePage(unittest.TestCase):
def test_extract_data(self):
sample_input = ['<tr><h1>keyThis</h1><h2>\xc2</h2><h3>\xa0</h3><h4>view\xc2\xa0book\xc2\xa0info</h4><h5>Test Passes</h5></tr>']
expected_res = ['This Test Passes']
res = list(extract_data(sample_input))
self.assertEqual(expected_res, res)
if __name__ == '__main__':
unittest.main()
</code></pre>