ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
227 stars 29 forks source link

migrate from `torequests` to `httpx`. #148

Open T-256 opened 2 months ago

T-256 commented 2 months ago

less dependencies and lighter weight

ClericPy commented 2 months ago

Indeed, I had planned to remove torequests from the ichrome library two years ago. The reason why I chose aiohttp at the beginning was that its concurrency capability was an order of magnitude higher than other libraries (httpx and requests are much slower).

On the one hand, aiohttp itself comes with a Websocket coroutine client. When ichrome was first created, there were few options with such matching functions.

During the recent period, I first implemented a morebuiltins library to replace various functions in torequests.utils, and then the next step was to start httpx to replace the http and websocket parts of aiohttp.

I was busy at work and could only write code a little bit in my spare time. If you are looking forward to a more professional library, you can consider the Playwright series of Microsoft Team. One of the reasons for the creation of ichrome was that there were no options at the time, so it was developed on a temporary basis. Relatively speaking, the test coverage is not as good as most other libraries currently