Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 713 Bytes

advanced.rst

File metadata and controls

34 lines (22 loc) · 713 Bytes

Advanced Usage

low-level curl API

Alternatively, you can use the low-level curl-like API:

from curl_cffi import Curl, CurlOpt
from io import BytesIO

buffer = BytesIO()
c = Curl()
c.setopt(CurlOpt.URL, b'https://tls.browserleaks.com/json')
c.setopt(CurlOpt.WRITEDATA, buffer)

c.impersonate("chrome110")

c.perform()
c.close()
body = buffer.getvalue()
print(body.decode())

scrapy integrations

If you are using scrapy, check out these middlewares: