_mysql_exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that correspo
nds to your MySQL server version for the right syntax to use near \'), (\'\\\'<div class=\\\\"cat\\\\"><p><a href=\\\\"h
The thing is that my original code, quoted earlier in the thread, works fine with an xpath like:
It fails to insert all of the information retrieved, even though I know that the info is scraped. This is the output for a desc item when I print to json using the more complex expression cited above. Note that both the 'cat' class and the "entry" class is scraped.
{"desc": ["<div class=\"cat\"><p><a href=\"
http://dinsvenska.se/category/ordfoljd/\" title=\"Se alla inl\u00e4gg i Ordf\u00f6ljd\" rel=\"category tag\">Ordf\u00f6ljd</a> av <a href=\"
http://dinsvenska.se/author/anna-danielsson/\" title=\"Inl\u00e4gg av Anna Danielsson\" rel=\"author\">Anna Danielsson</a></p></div>", "<div class=\"entry\"><p>Ja, det g\u00e5r bra.</p><div class=\"clear2\"></div></div>"]}
And this is the information for the same item when inserted to a mysql using my original pipeline:
<div class="entry"><p>Ja, det går bra.</p><div class="clear2"></div></div>
It only inserts the last part of the expression, namely the "entry" class. It could be that the loop is causing this. But if this is the case, how can I insert the items without using it. My item output follows the pattern:
[{"link": "link", "titel": ["titel"], "desc": ["descraiption"]},
{"link": "link", "titel": ["titel"], "desc": ["descraiption"]},
{"link": "link", "titel": ["titel"], "desc": ["descraiption"]}]
/Gustav