so i want to make auto download when i got some link, let say the link is : http://test.com/somefile.avi
import os
import sys
from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget, QWidgetAction
from PyQt5.QtCore import QUrl, QEventLoop
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineProfile, QWebEngineDownloadItem, QWebEnginePage
class WebPage(QWebEngineView):
def __init__(self):
QWebEngineView.__init__(self)
self.load(QUrl("http://test.com"))
self.loadFinished.connect(self._on_load_finished)
self.n = 0
def _on_load_finished(self):
print("Finished Loading")
self.page().toHtml(self.Callable)
def Callable(self, html_str):
self.html = html_str
self.load(QUrl(userInput))
if __name__ == "__main__":
userInput = input()
app = QApplication(sys.argv)
web = WebPage()
except i only have the page 'test.com', but i cant get the file 'somefile.avi', is it possible to make it autodownload after i input the 'http://test.com/somefile.avi' in console?
Thanks