python練習:爬取淘寶網商品、規格、評論信息存入數據庫,頁面支持簡單的搜索展示
成果:https://github.com/PrettyPanda/MyTaoBao/tree/master
成果展示:
python問題總結:
1.UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256) Scrapy
參考地址:
https://www.cnblogs.com/Skrillex/p/7093488.html
https://blog.csdn.net/mayuko2012/article/details/59126290
https://blog.csdn.net/csdnwws/article/details/51954825
2.python三種字符串鏈接方式:
https://www.cnblogs.com/chenjingyi/p/5741901.html + join %替換
3.pymysql.err.InternalError: (1366, "Incorrect string value: '\\xE7\\xAC\\x94\\xE8\\xAE\\xB0...' for column 'title' at row 1")
參考地址:https://blog.csdn.net/u011242745/article/details/51660344
4.Python uuid的使用
https://www.cnblogs.com/dkblog/archive/2011/10/10/2205200.html
5.TypeError: not all arguments converted during string formatting
缺少%s、%d
6.TypeError: 'NoneType' object is not subscriptable
7.mac配置cgi
mac自帶cgi
https://blog.csdn.net/zhzdeng/article/details/52608199
加載文本,不執行腳本問題:https://blog.51cto.com/xpleaf/1740221 需要打開模塊
8.httpd
https://blog.csdn.net/wangye1989_0226/article/details/72782103
9.UnicodeEncodeError: 'ascii' codec can't encode characters in position 20-24: ordinal not in range(128)
https://blog.csdn.net/love_rongrong/article/details/17119261 保存文件是得是中文
在腳本前加上如下兩句即可正常顯示中文。
https://blog.csdn.net/zhanyongjia_cnu/article/details/77996055
import codecs, sys
sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)
10.End of script output before headers
腳本有問題哈
11.Permission denied: AH01241: exec of '/Users/panda/PycharmProjects/untitled/test/web/cgi/first.py' failed
權限問題
12.python like語句的問題
https://blog.csdn.net/chenxiao_ji/article/details/51332791