Skip to content

Instantly share code, notes, and snippets.

@lachenmayer
Created April 18, 2012 02:06
Show Gist options
  • Save lachenmayer/2410572 to your computer and use it in GitHub Desktop.
Save lachenmayer/2410572 to your computer and use it in GitHub Desktop.
BeautifulSoup bug
# Should not parse the script tag inside quotes in the JavaScript.
# Expected: BeautifulSoup object
# Actual: HTMLParser.HTMLParseError: bad end tag: u"</' + 'script>", at line 1, column 22
from bs4 import BeautifulSoup
html = "<html><head><script>'</' + 'script>';</script></head><body></body></html>"
BeautifulSoup(html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment