lexiforest / curl_cffi

Python binding for curl-impersonate fork via cffi. A http client that can impersonate browser tls/ja3/http2 fingerprints.
https://curl-cffi.readthedocs.io/
MIT License
2.54k stars 269 forks source link

Retrieving Full Cookie Attributes with curl_cffi for Chrome Driver #280

Closed mobti100 closed 8 months ago

mobti100 commented 8 months ago

I am currently using the curl_cffi library to make HTTP requests in an asynchronous manner. My goal is to retrieve cookies from a response and then set them in a Chrome driver. The Chrome driver expects cookies in a specific format, which includes attributes such as domain, expiry, httpOnly, name, path, sameSite, secure, and value.

However, with curl_cffi, I am only able to retrieve the name and value of the cookies. I need to access the full set of cookie attributes as required by the Chrome driver.

I expect to be able to retrieve a complete set of cookie attributes (domain, expiry, httpOnly, name, path, sameSite, secure, value) after making a request with curl_cffi.

deedy5 commented 8 months ago

See if this helps you - https://github.com/daijro/browserforge But I haven't checked to see if it works

coletdjnz commented 8 months ago

you can use a cookiejar to get these values

cookies supports a cookiejar

https://docs.python.org/3/library/http.cookiejar.html#module-http.cookiejar