Closed 5j9 closed 1 year ago
@5j9 You right, some cookies from current session are missing. but from what you sent something is strange,
len(rookiepy.firefox())=675
len(browser_cookie3.firefox())=7104
what's the numbers 675
and 7104
?
Not sure if my method of comparison above is correct
Me neither.
Idea: Print the cookies names. With rookie
and for comparison with browser_cookie3
.
Idea: Print the cookies names. With
rookie
and for comparison withbrowser_cookie3
.
Here is another example with names printed:
import browser_cookie3, rookiepy
print('rookiepy:')
for c in rookiepy.firefox(['github.com']):
print(c.name)
print('\n\nbrowser_cookie3:')
for c in browser_cookie3.firefox(domain_name='github.com'):
print(c.name)
Prints:
rookiepy:
_octo
logged_in
_device_id
dotcom_user
fileTreeExpanded
_docs-events
user_session
__Host-user_session_same_site
has_recent_activity
browser_cookie3:
_octo
logged_in
dotcom_user
fileTreeExpanded
color_mode
preferred_color_mode
tz
_device_id
user_session
__Host-user_session_same_site
has_recent_activity
_gh_sess
ignored_unsupported_browser_notice
tz
_docs-events
_csrf
LiSESSIONID
_gh_sess
_helphub_session
state
logged
token
_support_session
what's the numbers
675
and7104
?
They are the result of python f-string evaluation.
print(f'{1+1=}')
# prints:
# 1+1=2
@5j9 Oh I see, but I'm still not sure how many cookies you have from each function
len(rookiepy.firefox())=675 <- this is the len?
len(browser_cookie3.firefox())=7104 <- this is the len?
47 <- what's that?
51 <- what's that?
Sorry for the messy example. I should've used the same syntax for all print statements. Basically
length of rookiepy.firefox()
was 675.
length of browser_cookie3.firefox()
was 7104.
length of rookiepy.firefox(['google.com']))
was 47.
length of browser_cookie3.firefox(domain_name='google.com')
was 51.
Thanks.
I'm working on adding session cookies to rookie in firefox
as well.
in the meanwhile, if it's possible for you to check again the length with little modification in browser_cookie3
it would be great.
ide
it should go there)browser_cookie3/__init__.py
LINE 980
browser_cookie3/__init__.py
LINE 981
just comment out both in your library which you installed on your PC
, and check again the lengths to see if it's the same as from rookiepy
comment out both in your library which you installed on your
PC
, and check again the lengths to see if it's the same as fromrookiepy
After the change the difference is almost gone (actually rookiepy is showing a few more cookies this time):
rookiepy.firefox()
was 668.browser_cookie3.firefox()
was 587.rookiepy.firefox(['google.com'])
was 47.browser_cookie3.firefox(domain_name='google.com')
was 43.Thanks for checking, that means it probably the reason,
I published new version which takes session cookies as well :)
You can update it with
pip install -U rookiepy
Great!
With version 0.2.5 installed:
length of rookiepy.firefox()
was 7401.
length of browser_cookie3.firefox()
was 7096.
length of rookiepy.firefox(['google.com'])
was 6779.
length of browser_cookie3.firefox(domain_name='google.com')
was 50.
Note that now specifying domains seems to have lost its filtering effect and rookiepy.firefox(['google.com'])
returns an unusually high number of cookies.
rookiepy.firefox(['google.com'])
returns an unusually high number of cookies.
Resolved in v0.2.6. Perfect! Thank you!
On my Windows 10 system the above scripts prints:
Not sure if my method of comparison above is correct, but it looks to me that browser_cookie3 is able to find more cookies.