Question

I'm getting:

exceptions.TypeError: not all arguments converted during string formatting

from this:

cursor.execute("SELECT * FROM `item` WHERE `url` = %s", (urljoin( base_url, item_url ) ))

Syntax seems fine - any ideas?

Was it helpful?

Solution

The issue here is you are passing in a string, where you should be passing in a tuple. Note the extra comma at the end:

execute("SELECT * FROM `item` WHERE `url` = %s", (urljoin(base_url, item_url),))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top