g = Grab()
g.go('http://domain.com/')
print g.search_rex(re.compile("/(Set:|document=['\"])(.*?)(path*?)/i", g.response.body)).group(1)
В результате:
File "/usr/lib/python2.6/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.6/re.py", line 243, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.6/sre_compile.py", line 506, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python2.6/sre_parse.py", line 679, in parse
p = _parse_sub(source, pattern, 0)
File "/usr/lib/python2.6/sre_parse.py", line 314, in _parse_sub
itemsappend(_parse(source, state))
File "/usr/lib/python2.6/sre_parse.py", line 407, in _parse
if state.flags & SRE_FLAG_VERBOSE:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
Где косяк?