from nltk import clean_html
from BeautifulSoup import BeautifulStoneSoup
content = '''Is anyone else having troubles with Bluetooth on a Moto X?
\u00a0It connects fine to my car when I make a call, but the bluetooth drops in
and out, and the phone prompts me to ask whether I want to use the speakerphone,
the headset, or the bluetooth - but a few seconds later, it connects back to bl
uetooth. \u00a0And oddly, it only happens some of the time. \u00a0And other uses
of Bluetooth from the phone - for example, playing an audiobook or music - demo
nstrate no similar behavior.<br /><br />It's a disastrous bug. Making me thi
nk about switching to another phone, even though I love this one. \u00a0And it s
eems to have been introduced only in the past month or so, as the phone worked f
ine with the car before that.<br /><br />And yes, I've tried forgetting and
re-initiating the bluetooth connection.\ufeff'''
# clean_html removes tags and
# BeautifulStoneSoup converts HTML entities
def cleanHtml(html):
if html == "": return ""
return BeautifulStoneSoup(clean_html(html),
convertEntities=BeautifulStoneSoup.HTML_ENTITIES).contents[0]
print content
print
print cleanHtml(content)
Is anyone else having troubles with Bluetooth on a Moto X?
\u00a0It connects fine to my car when I make a call, but the bluetooth drops in
and out, and the phone prompts me to ask whether I want to use the speakerphone,
the headset, or the bluetooth - but a few seconds later, it connects back to bl
uetooth. \u00a0And oddly, it only happens some of the time. \u00a0And other uses
of Bluetooth from the phone - for example, playing an audiobook or music - demo
nstrate no similar behavior.<br /><br />It's a disastrous bug. Making me thi
nk about switching to another phone, even though I love this one. \u00a0And it s
eems to have been introduced only in the past month or so, as the phone worked f
ine with the car before that.<br /><br />And yes, I've tried forgetting and
re-initiating the bluetooth connection.\ufeff
Is anyone else having troubles with Bluetooth on a Moto X?
\u00a0It connects fine to my car when I make a call, but the bluetooth drops in
and out, and the phone prompts me to ask whether I want to use the speakerphone,
the headset, or the bluetooth - but a few seconds later, it connects back to bl
uetooth. \u00a0And oddly, it only happens some of the time. \u00a0And other uses
of Bluetooth from the phone - for example, playing an audiobook or music - demo
nstrate no similar behavior. It's a disastrous bug. Making me thi
nk about switching to another phone, even though I love this one. \u00a0And it s
eems to have been introduced only in the past month or so, as the phone worked f
ine with the car before that. And yes, I've tried forgetting and
re-initiating the bluetooth connection.\ufeff
from nltk import clean_htmlfrom BeautifulSoup import BeautifulStoneSoupcontent = '''Is anyone else having troubles with Bluetooth on a Moto X?\u00a0It connects fine to my car when I make a call, b