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.34k stars 255 forks source link

[Feature] Add a `.markdown()` function for response #339

Open perklet opened 4 months ago

perklet commented 4 months ago

Extract LLM-friendly markdown text from response.

Is your feature request related to a problem? Please describe. N/A

Describe the solution you'd like

from curl_cffi import requests

r = requests.get("https://example.com/content-20240704.html")

text = r.markdown()

Describe alternatives you've considered N/A

Additional context Dependeices should be optional, probably with pip install curl-cffi[extra]