看看我的日志,看看它是怎么说的,我从Postgres返回的行已经从一个字符串变成了一个元素(我打印字符串,打印元素,打印isElement boolean!)但是当我试图附加它时,错误是它不是一个元素。气喘吁吁。在import sys
from HTMLParser import HTMLParser
from xml.etree import cElementTree as etree
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element, SubElement, tostring
import psycopg2
import psycopg2.extras
def main():
# Connect to an existing database
conn = psycopg2.connect(dbname="**", user="**", password="**", host="/tmp/", port="**")
# Open a cursor to perform database operations
cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor)
cur.execute("SELECT * FROM landingpagedata;")
rows = cur.fetchall()
class LinksParser(HTMLParser):
def __init__(self):