-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing cookies to QWebEngineView using python #155
Labels
Comments
https://doc.qt.io/qt-5/qwebenginecookiestore.html add cookie for url |
@892768447 any sample code on how to do that ? |
cookieStore.setCookie(cookies.front(), url) |
@892768447 as per your suggestion I changed the code like below
I'm getting below error
btw how can we specify the file path for "cookie.txt" ? |
webEngineProfile = QWebEngineProfile.defaultProfile()
cookieStore = webEngineProfile.cookieStore()
#https://doc.qt.io/qt-5/qwebenginecookiestore.html#setCookie
#cookieStore.setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl())
cook = QNetworkCookie()
cook.setDomain('ww.udemy.com')
#cook.setExpirationDate(QDateTime) # date
cook.setPath('/')
cook.setValue('c6sdf99-1sdab-4sd1-86ff-2dc8sfs24511'.encode())
cookieStore.setCookie(cook , QUrl(url)) you can search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so I have a python code which converts url to pdf like below
I have a cookie.txt with the content below
is there a way to pass my cookie.txt to QWebEngineView or QtWebEngineWidgets ??
The text was updated successfully, but these errors were encountered: