Comments (3)
i'm not of developer of this code, but an cast some light about your suggestions.
first 3rd solution: its easy to to do.
second 1st solution: its easy to do too, but will have same problem if you use multi accounts cross browsers, for example if you used account A in firefox and account B in chrome and both of theirs cookies did not expire it will always return account A as load() use loop in which chrome is first of the list and firefox is last so if cookie exist in firefox (and implying this solution is valid) it will return firefox cookie
lastly 2nd solution: this is very hard if not impossible, because this code return the cookies in default python urllib2 (the base that other module use to connect to internet like requests) format aka cookiejar methods, which use domain name as key, so the best solution is to create variable for browser that you want (firefo_cookies, chrome_cookies...etc) then chose the variable that you want.
from browser_cookie3.
i was doing some test and found out that even 1st solution is hard (not very hard) because cookies don't expire at same time (for example cloudflare cookies expire super fast) and some sensitive (like auth cookies) can become invalid if use use cookies from multi browser (something to do with useragent)
and as i mentioned in other post its better to use multi variable as cloudflare cookies will be invalid if you used wroung user agent (like using chrome useragent with firefox cloudflare cookies)
from browser_cookie3.
I am experiencing the same problem.
How about modifying load()
(or adding a new method like load_all()
or something) that returns a dictionary of cookie jars? One entry per browser for which it could find cookies.
That would make it easier for the user to iterate through the cookies of different browsers.
from browser_cookie3.
Related Issues (20)
- browser_cookie3 using outdated cookies? HOT 1
- increasing the use of your code HOT 1
- browser_cookie3.firefox() fails in 0.19 due to incorrect json.load() use HOT 1
- Cookie value in browser console differs from the one obtained in code. HOT 1
- Support for Mac version Arc browser HOT 1
- Chrome v115 broke support HOT 1
- SNlM0e value not found. HOT 2
- Stop working on Brave HOT 4
- Stopped working on Edge and Chrome HOT 10
- ResourceWarning: unclosed file <_io.BufferedRandom name='path/to/tmp_mxwkwqh.sqlite'>
- Any updates on new Chrome Version 118.0.5993.120 ?
- Script fails to run in MacOS crontab. HOT 3
- Does this work in headless environment? HOT 1
- How can automaticly get cookies value in no gui servers? HOT 4
- Not Working On Windows OS HOT 1
- Firefox cookies from given container in Multi-Account Containers HOT 3
- KeyError: 'DBUS_SESSION_BUS_ADDRESS'
- Using a Chrome instance to point and use cookies gathered
- Chromium Linux cookies path does not include Snap Chromium path
- Error loading Chrome cookies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browser_cookie3.