AttributeError:'set’object has no attribute’items’问题解决办法
原因:出现 AttributeError:‘set’object has no attribute’items’ 报错通常是代码中 "headers"出现问题
headers正确定义格式:
headers = {“key”:“value”}
headers = {“User-Agent”:“xxx”}
headers = {"User-Agent":"xxx"}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
出错格式:
headers = {"User-Agent : xxx"}
headers = {"User-Agent":xxx"}
headers = {"User-Agent:"xxx"}
注:看清key和value的冒号
“”/‘’
是否都有