daijro / hrequests

🚀 Web scraping for humans
https://daijro.gitbook.io/hrequests/
MIT License
654 stars 39 forks source link

Unsupported chrome version error #30

Closed danielcrane closed 8 months ago

danielcrane commented 9 months ago

Hi there, when running a simple hrequests.get command on Ubuntu I get the following error:

<bound method ? of <class 'hrequests.session.chrome'>>` is not a supported chrome version: (103, 104, 105, 106, 107, 108, 109, 110, 111, 112)

This happens when both installing via hrequests[all] and hrequests.

Was wondering if anyone else has run into this, or could help me debug?

Thanks!

danielcrane commented 9 months ago

I found the issue, it seems to be the case that using @classmethod and @property together is only supported in Python 3.9 onwards - and so the following lines don't work in 3.8 or earlier:

https://github.com/daijro/hrequests/blob/4953babe2fb76412629e08967ea19575e83ba97e/hrequests/session.py#L243-L246

@daijro it might be a good idea to either change the Python version tag on the repo to 3.9 onwards, or ideally find some other solution here? Happy to help if you'd like me to figure something out.

Doing something as simple as removing the @property decorator and calling it via cls.version() wouldn't be as elegant, but would work for more Python versions afaik.

daijro commented 8 months ago

In my latest commit, I ended up removing @property and calling it via cls.version() to keep 3.7 and 3.8 supported. Didn't want to cut anyone's projects off from a new update haha