regex searching through a Python dict: TypeError: expected string or buffer -
i'm using imapclient in python fetch email bodies trying utilize regex homecoming http link within body. i'm not sure if i'm going right/easiest way extract http link dict? if so, how convert dict string re can parse it? tried few things , decided inquire help
body = c.fetch(rc,'rfc822') confirmation_link = re.findall('click link confirm registration:<br />" (.*?)"', body) conf in confirmation_link:
my body variable i'm passing re consist of imapclient returning fetch is:
defaultdict(<type 'dict'>, {10: {u'seq': 10, u'rfc822': ....lots more key:values}
error:
line 177, in findall homecoming _compile(pattern, flags).findall(string) typeerror: expected string or buffer
python regex dictionary
No comments:
Post a Comment