What's the problem with this code? Works for pyqt5 but not for pyqt6.
-
When I run everything works fine except it stops at instagram splash/loading screen, even the right click menu option don't work.
*Note the output come everytime same in every pyqt app
- There is no problem with internet connection.
import sys from PyQt6.QtWidgets import * from PyQt6.QtWebEngineWidgets import QWebEngineView from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineProfile from PyQt6.QtCore import QUrl class Main(QWebEngineView): def __init__(self): super().__init__() self.profile = QWebEngineProfile("data", self) # Create a off-road profile with parent self self.profile.setPersistentCookiesPolicy (QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies) # Force the cookie to be stored in disk self.profile.setHttpCacheType(QWebEngineProfile.HttpCacheType.DiskHttpCache) # Cache is stored in disk self.profile.setPersistentStoragePath('data') # Cookie path in data folder in root self.profile.setCachePath('data') # Cache path in data folder in root self.page = QWebEnginePage(self.profile) # Create a page with profile from above self.setPage(self.page) # not set page to QWebEngineView self.load(QUrl("https://www.instagram.com")) # load the url in view self.show() app = QApplication(sys.argv) main = Main() app.exec()
#qwebengine
-
When I run everything works fine except it stops at instagram splash/loading screen, even the right click menu option don't work.
*Note the output come everytime same in every pyqt app
- There is no problem with internet connection.
import sys from PyQt6.QtWidgets import * from PyQt6.QtWebEngineWidgets import QWebEngineView from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineProfile from PyQt6.QtCore import QUrl class Main(QWebEngineView): def __init__(self): super().__init__() self.profile = QWebEngineProfile("data", self) # Create a off-road profile with parent self self.profile.setPersistentCookiesPolicy (QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies) # Force the cookie to be stored in disk self.profile.setHttpCacheType(QWebEngineProfile.HttpCacheType.DiskHttpCache) # Cache is stored in disk self.profile.setPersistentStoragePath('data') # Cookie path in data folder in root self.profile.setCachePath('data') # Cache path in data folder in root self.page = QWebEnginePage(self.profile) # Create a page with profile from above self.setPage(self.page) # not set page to QWebEngineView self.load(QUrl("https://www.instagram.com")) # load the url in view self.show() app = QApplication(sys.argv) main = Main() app.exec()
#qwebengine
Hi and welcome to devnet,
Did you also check with PySide6 ?
PyQt is from Riverbank Computing so if there's a regression, you should check with them directly.
-
Hi and welcome to devnet,
Did you also check with PySide6 ?
PyQt is from Riverbank Computing so if there's a regression, you should check with them directly.
-
Your storage paths are the problem.
-
-
@SGaist said in What's the problem with this code? Works for pyqt5 but not for pyqt6.:
Your storage paths are the problem.
Make them point in a suitable folder (e.g. one that you have write access to) and it works.