报这个错是因为直接从浏览器复制过来的'User-Agent'有空格
'User-Agent':' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'
改成这样
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'标签:5.0,10.0,InvalidHeader,Mozilla,x64,537.36,NT From: https://www.cnblogs.com/wenwenlee/p/16625911.html
就可以了