Open theogiraudet opened 1 year ago
I am seeing this error too.
In _proxy_generator.py
, the self._session
object is an httpx.Client
, and the cookies
property on this client is a special Cookies
store provided by httpx
.
According to the httpx
docs, there are no attributes for accessing the parts of a cookie directly:
In [1]: from httpx import Cookies
In [2]: cookies = Cookies()
In [3]: cookies.set("chocolate cookie", "tasty", domain="example.org")
In [4]: type(cookies['chocolate cookie'])
Out[4]: str
In [5]: cookies['chocolate cookie']
Out[5]: 'tasty'
In [6]: cookies['chocolate cookie'].domain
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 cookies['chocolate cookie'].domain
AttributeError: 'str' object has no attribute 'domain'
In [7]: cookies['chocolate cookie'].value
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 cookies['chocolate cookie'].value
AttributeError: 'str' object has no attribute 'value'
What's strange is that if that's right, then the code on lines 405-413 could never have worked, which seems unlikely?
I am unable to reproduce this error, but the attributes from the httpx cookies certainly seem incorrect. These used to work on requests, but httpx doesn't seem to have the same behaviour.
Hi,
I see the error whenever a captcha is found. So for me, I have a program which invokes scholarly to try to get some abstracts from Google. After about 10-15 requests, even with random pauses in between, I encounter captcha, and this code block is entered, an exception thrown. The exception is caught, so the scholarly carries on trying to do what it was doing, though unsuccessfully.
Reactivating this issue here because I encounter the same problem, and hoping someone with more expertise than me might be able to solve it. I investigated a little bit and it seems that the cookies
variable -- at least in my case -- is just a string (e.g. 'NID'
or 'GSP'
). Hence the error Exception AttributeError while fetching page: ("'str' object has no attribute 'domain'",)
. Any help is very much appreciated! Thanks
Describe the bug When I execute a query without proxy, I have an error at captcha resolution blocking the fetch.
Here is the error:
The issue seems to come from
_proxy_generator.py#_handle_captcha2
, line 403 where thecookie
variable doesn't have the expecting value. This error isn't present when proxies are activated.To Reproduce
Expected behavior The print of the first result of the query.
Desktop (please complete the following information):
Do you plan on contributing? Your response below will clarify whether the maintainers can expect you to fix the bug you reported.