Answer the question
In order to leave comments, you need to log in
C++ and interaction with web pages, what do you recommend?
I decided to write a program (In C++, maybe later on Qt) to interact with the sites I need, for example, to log in, find the necessary information on the page, copy-paste it to a file / display it in the program window. Automate all this as much as possible. I've never dealt with this and don't even know where to start. I tried to google, but I found too much ambiguous unstructured information, but I would like to comprehend this matter gradually, with a full understanding of "what's what and why." Can you recommend any books/lessons/articles?
Answer the question
In order to leave comments, you need to log in
I don't know why C++ is here.
I advise you to do it in Python.
Python has a lot of handy tools for this.
For example requests or selenium web driver (in case there are a lot of javascript elements).
If you strictly want C++, then see libcurl , Qt uses QNetworkAccessManager
dig into the sockets ... -there you
establish a connection with the server socket
-send a request on the socket like you are a browser (there you can on behalf of anyone)
- and those in response are a buffer full of html content.
One nuance, pictures and icons are obtained by separate requests.
Here the browser does not take long to write your own
It's easy, even the example is standard for parsing HTML. To send requests, you can take the code from here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question