I encountered this problem today, and then Searched baidu, Bing and Google. I saw many blogs that wrote about this problem. To be honest, it was not helpful at all, so I spent 2 hours to find the reason by myself. The reason for this error is very simple. The reason for this error is that the header part is wrong.
may be the direct cause of the error, as some browsers have different formats, which may lead to extra white space in the header information when you paste it into the code
I’m copying and pasting this piece of code when I add header information, is that okay?But if you look closely at the content-type part, isn’t there a lot of space?Just delete the Spaces and you’re done.
I modified
![](https://programmerah.com/wp-content/uploads/2020/11/cca0de30f5938c3fa0a40702d578ffa7.png)
Crawl out of the data perfectly.
The first blog in my life, I hope you will pay more attention to me, I will continue to publish the blog about crawler in the future!!
![](https://programmerah.com/wp-content/uploads/2020/11/f03fc78e6862a7c3af84aa1e24e30408.png)
I’m copying and pasting this piece of code when I add header information, is that okay?But if you look closely at the content-type part, isn’t there a lot of space?Just delete the Spaces and you’re done.
I modified
![](https://programmerah.com/wp-content/uploads/2020/11/cca0de30f5938c3fa0a40702d578ffa7.png)
Crawl out of the data perfectly.
The first blog in my life, I hope you will pay more attention to me, I will continue to publish the blog about crawler in the future!!
Read More:
- egg.js The frame post request reported an error of invalid CSRF token security verification, which has been solved
- Solution of invalid host header in vue-cli3
- Error parsing HTTP request header Note: further occurrences of HTTP header p
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- There has been an error processing your request magento
- Magento prompts “there has been an error processing your request”
- Tomcat error parsing HTTP request header
- Flask Request an extension before_request after_request errorhandler
- error: invalid compressed data to inflate file #14: bad zipfile offset (local header sig):
- The sharepoint2010 site cannot open a solution that displays an “an unexpected error has occurred” error
- Invalid Host header
- Solution of VS2008 unable to open GL / glaux. H header file
- Solution: ubantu has an internal error
- An import error is reported in the python. The solution to setting. Pylintrc is invalid
- [Android] using request window feature( Window.FEATURE_ NO_ Title) method to remove the title invalid solution
- Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution
- Invalid host header error in Vue using peanut shell agent
- Tomcat error: error parsing HTTP request header
- java.lang.IllegalArgumentException: Index for header ‘XXX‘ is 1 but CSVRecord only has 1 value
- The COMMIT TRANSACTION request has no corresponding BEGIN