Giter Site home page Giter Site logo

Some cookies are missing(?) about rookie HOT 10 CLOSED

5j9 avatar 5j9 commented on June 4, 2024
Some cookies are missing(?)

from rookie.

Comments (10)

5j9 avatar 5j9 commented on June 4, 2024 2

rookiepy.firefox(['google.com']) returns an unusually high number of cookies.

Resolved in v0.2.6. Perfect! Thank you!

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024 1

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.

  1. Navigate to the browser_cookie3 folder (just click some function in your ide it should go there)
  2. and then change here:

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

from rookie.

5j9 avatar 5j9 commented on June 4, 2024 1

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

After the change the difference is almost gone (actually rookiepy is showing a few more cookies this time):

  • length of rookiepy.firefox() was 668.
  • length of browser_cookie3.firefox() was 587.
  • length of rookiepy.firefox(['google.com']) was 47.
  • length of browser_cookie3.firefox(domain_name='google.com') was 43.

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024 1

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

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024

@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?

from rookie.

stappersg avatar stappersg commented on June 4, 2024

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.

from rookie.

5j9 avatar 5j9 commented on June 4, 2024

Idea: Print the cookies names. With rookie and for comparison with browser_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 and 7104?

They are the result of python f-string evaluation.

print(f'{1+1=}')
# prints:
# 1+1=2

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024

@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?

from rookie.

5j9 avatar 5j9 commented on June 4, 2024

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.

from rookie.

5j9 avatar 5j9 commented on June 4, 2024

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.

from rookie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.