Skip to content

Instantly share code, notes, and snippets.

@shmohawk
Created March 29, 2018 04:23
Show Gist options
  • Save shmohawk/5ee3278246e3228a9a942bc5ebe1b4e0 to your computer and use it in GitHub Desktop.
Save shmohawk/5ee3278246e3228a9a942bc5ebe1b4e0 to your computer and use it in GitHub Desktop.
diff --git a/alfix.py b/alfix.py
index eed2f61..b874148 100755
--- a/alfix.py
+++ b/alfix.py
@@ -9,6 +9,7 @@ import gzip
from lxml import etree
from lxml import html
from lxml.html import builder as E
+from lxml.html import soupparser
from urllib.parse import urlparse, parse_qsl
from http import HTTPStatus
@@ -163,7 +164,7 @@ class myHandler(http.server.SimpleHTTPRequestHandler):
contents = self.page.get_element_by_id('contents')
for i in fetch(self.db, sql):
- doc = etree.fromstring(i['VALUE_XML'])
+ doc = soupparser.fromstring(i['VALUE_XML'])
res = transform(doc, codep='0', cdPath='"./"', linkUrl='""')
tbl = res.find('//table')
contents.append(tbl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment