By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,154 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,154 IT Pros & Developers. It's quick & easy.

'tuple' object has no attribute 'encode'

P: 1
......
items = re.findall(reg,html)
for item in items:
print item.encode("utf-8")
if I use "print item", the results are "(u'\u5e7f\u5dde-\u5929\u6cb3\u533a', u'0.8-1.5\u4e07/\u6708')"
so I use "print item.encode("utf-8")",but it shows "'tuple' object has no attribute 'encode'"
May 2 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.