示例#1
0
    def test_normal(self):
        rule = '''
value:
  prefix: 'lang="'
  suffix: '"'
'''
        value = main.extract_from_url('http://www.ebay.com/', rule)
        self.assertEquals('en', value)
示例#2
0
 def test_error(self):
     with self.assertRaises(HTTPError):
         main.extract_from_url('http://www.ip138.com/abc', '')