在写爬虫相关程序时候,会出现各式各样问题。
问题汇总:
一、pip install docx 安装模块 docx 后,发现不能正常使用,报错
moduleNotFoundError:No module named ‘exceptions’
解决方法:
解决方法如下:
1、卸载原来安装的docx
pip uninstall docx
2、安装 python-docx 模块即可
pip install python-docx
二、爬虫爬取数据时,同时有地址和标题两个参数需要循环
解决方法:
提示:在for语句中加入zip函数解决
for item,item2 in zip(li_url,li_title):
print(item,item2)