Detailed explanation of the method of obtaining the specified website cookie data stored by the chrome80 Google browser

I. Introduction

I am ashamed to say that, as a blogger who opened a crawler column, for crawler applications that need to log in and then visit the website, I use the browser developer mode to obtain cookies, and then copy them into the code for website access to build http request headers way to achieve.

In the past two days, I have carefully studied the access of Google browser cookies, and found that it is possible to directly obtain the cookies of the browser to access the specified website through the code, but the relevant methods on the website are based on the version before chrome 80, and this version and later Previous versions did not work. Finally, I found " chrome 80+ sqlite3 cookie decryption " by CSDN blogger "whenyouarebigger" , and found the cause of the problem.

According to the introduction of whenyouarebigger's blog post, I did some tests and found that there are still some problems with the content introduced in this article, and it cannot be run directly. In addition, it is not structured to apply cookies that can be used directly in the request header. By comparing the cookies of the browsers, the cause of the problem was finally found, and the problem was finally completely solved. Today I summarize it for your reference.

2. Introduction to the encryption and decryption mechanism of Chrome browser

2.1, the encryption and decryption mechanism of versions before chrome80

The encryption and decryption of versions before chrome80 are directly encrypted and decrypted through DPAPI:

  1. DPAPI is an interface for encrypting and decrypting data at the Windows system level, and users do not need to implement encryption by themselves.

Guess you like

Origin blog.csdn.net/LaoYuanPython/article/details/116138542