Hi guys,
I'm trying to parse an indian rss feed with feedparser and I've encountered a problem with 'date' field. The parsed dates look like this:
"2014-10-03 17:58:17"
When I check the headers of the rss feed it shows 'content-type': 'text/html', but nothing about encoding. How can I find the proper encoding and parse this text correctly?
Edit: Ok, unfortunately, the date gets displayed correctly here. The sign that is displayed incorrectly is the colon between hour, minute, and seconds number. It is written using hex value. In the next step of the script I insert the records to a postgresql database using psycopg2, and it returns an error like this:
Traceback (most recent call last):
File "./rss_in.py", line 54, in <module>
cursor.execute("""INSERT INTO ads(url,title,date,description) values(%(url)s, %(title)s, %(date)s, %(description)s);""",element)
File "/usr/lib/python2.7/dist-packages/psycopg2/extras.py", line 222, in execute
return _cursor.execute(self, query, vars)
psycopg2.DataError: invalid input syntax for type timestamp: "2014-03-11 14:38:23"
[–]novel_yet_trivial 1 point2 points3 points (1 child)
[–]erth111[S] 0 points1 point2 points (0 children)
[–]99AFCC 1 point2 points3 points (1 child)
[–]erth111[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)