not all arguments converted during string formatting error
来源:8-7 scrapy实现ip代理池 - 2
Grant_Lian
2017-05-13
Connected to pydev debugger (build 171.3780.115) Traceback (most recent call last): File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1578, in <module> globals = debugger.run(setup['file'], None, None, is_module) File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1015, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/Users/Documents/project/crawler/ArticalSpider/tools/crwal_xici_ip.py", line 39, in <module> crawl_ips() File "/Users/Documents/project/crawler/ArticalSpider/tools/crwal_xici_ip.py", line 34, in crawl_ips (ip_info[0], ip_info[1], ip_info[3], ip_info[2]) File "/Users/.virtualenvs/article_spider/lib/python3.6/site-packages/pymysql/cursors.py", line 164, in execute query = self.mogrify(query, args) File "/Users/.virtualenvs/article_spider/lib/python3.6/site-packages/pymysql/cursors.py", line 143, in mogrify query = query % self._escape_args(args, conn) TypeError: not all arguments converted during string formatting
老师 我跟着你爬西刺的时候遇到这个错误,改了好多次都不行,代码如下
写回答
1回答
-
这个错误是因为你的字符串里面的 %s 数量和 实际传递进入的数量不一样, 你数一下两者数量是否相等, 然后你要用%s 试着将 {1}这种模式换为%s这种模式试试呢
012017-05-14
相似问题