Can Qt develop script programs?
-
I want to use Qt to develop a script program, the program can operate a web page of a website, for example: the web page has some columns, each column has a button + some other data, and my program can do: can decide whether to press the corresponding button according to the size of the data in the column. This saves me manual operations.
If I want to implement such an app, what do I need to learn? can someone help me provide some tutorials with similar functional apps? just like the one on Github. Or, point me to the learning documents about this content, such as Qt links to academic qualifications and the like.
Hope the epidemic will disappear soon! Thank you for your precious time!
-
@Poor-English said in Can Qt develop script programs?:
I want to use Qt to develop a script program, the program can operate a web page of a website
What sort of a "script program"? Manipulating a web page is normally JavaScript. Qt has either
QtWebEngine
for your own Chromium browser page, or WebAssembly for a complete Qt desktop program but run in a browser. -
It's been a long time since I saw my respected Mr. Cat!
Take our Qt forum as an example. For example, I want to write an application that can help me bookmark automatically: this application can find all the replies with a quote greater than 2 under a certain post, and then bookmark each eligible reply ( The script application will "click" 3 dots, and then "click "bookmark" in the pop-up list. What should I learn?PS: Now I am going to get off the plane, I may not reply in time, I would like to say hello to Mr. Cat!
-
@Poor-English said in Can Qt develop script programs?:
The script application will "click" 3 dots, and then "click "bookmark" in the pop-up list. What should I learn?
I do not know how you would propose to do that in what is a web page. A normal Qt application is not going to be able to do this. I would imagine you would have to write an "add-in" for each & every browser you wish to support (Chrome, Firefox, ...), and nothing to do with Qt. Unless someone else here knows better?
-
@JonB said in Can Qt develop script programs?:
I do not know how you would propose to do that in what is a web page. A normal Qt application is not going to be able to do this. I would imagine you would have to write an "add-in" for each & every browser you wish to support (Chrome, Firefox, ...), and nothing to do with Qt. Unless someone else here knows better?
Thank you for your advice. can Qt do the following?
--Crawl the content of the webpage,read then data of the webpage, and then submit a request to this webpage?
ps: I may not come back in the next period of time or reply in time. -
@JonB said in Can Qt develop script programs?:
@Poor-English said in Can Qt develop script programs?:
The script application will "click" 3 dots, and then "click "bookmark" in the pop-up list. What should I learn?
I do not know how you would propose to do that in what is a web page. A normal Qt application is not going to be able to do this. I would imagine you would have to write an "add-in" for each & every browser you wish to support (Chrome, Firefox, ...), and nothing to do with Qt. Unless someone else here knows better?
I agree with @JonB: A HTML + JavaScript browser extension is more appropriate for this job. For example: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
@Poor-English said in Can Qt develop script programs?:
can Qt do the following?
--Crawl the content of the webpage,read then data of the webpage, and then submit a request to this webpage?Yes.
If the web page does not rely on client-side JavaScript to generate its data, then
QNetworkAccessManager
is enough: https://doc.qt.io/qt-5/qnetworkaccessmanager.htmlOtherwise, use the Qt WebEngine module to render the web page before processing its data: https://doc.qt.io/QT-5/qtwebengine-index.html
-
@JKSH
Sorry for taking up your time again. some time ago, due to the epidemic, I could not reply in time under this post, sorry.According to your guidance and Qt's tutorial, I created a simple"Qt WebEngine Examples", but after clicking the run button, Qt create prompts me with an error as follows: ":-1: error: Unknown module(s) in QT: webengine", do your know what kind of error this is? Will it also appear on your machine?
-
@Poor-English The error means that you did not install webengine. If you used Qt Online Installer then open Maintenance Tool and select Qt WebEngine under the Qt version you installed.