Correctly handle text. .string does weird things.
This commit is contained in:
parent
89472538eb
commit
c53ffa66dc
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ def messageHandler(sender, recipient, mid, date, driver, mode = 0, db = dbtools.
|
|||
juha = BeautifulSoup(driver.page_source, "html5lib")
|
||||
text = juha.select("div.msg div")[0]
|
||||
|
||||
db.executeQuery("INSERT INTO messages(id, text, sender_id, recipient_id, created_at) VALUES('%s', '%s', '%s', '%s', '%s');" % (mid, setuptools.unescapeText(text.string or "").strip(), sender, recipient, date))
|
||||
db.executeQuery("INSERT INTO messages(id, text, sender_id, recipient_id, created_at) VALUES('%s', '%s', '%s', '%s', '%s');" % (mid, setuptools.unescapeText(text.text).strip(), sender, recipient, date))
|
||||
db.commit()
|
||||
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue