0

I am learning boost/asio. I can do an endpoint, active and passive sockets. Now I want to write something like a simple client application, which will get specific data from web pages. So I have few questions about that:

  1. If I have a done an socket, which is related with a web page, how can specify some content on the page. For example, I want to get an image. There are many images on the page. Not only images. I want to identify specific image. How can i do that?(may be and "id" from html or some how else).

  2. After that I want to get that specific image on my PC. How can I download it and save it? If it is not image, if I want to work with audio file, video file, text, hyperlink and e.t.c. How to generalize it for any type of content?

  3. How can I follow links on web page?

You also may use boost/beast in answer for this question.

offtop (cpp is not good idea for dealing with that stuff, I know that)

  • This is overly broad. I would never do this in c++. Regardless, if you must, you'll have to have a specific problem for others to be able to help. For now I'd say "wget is your friend". Otherwise, https://www.crummy.com/software/BeautifulSoup/bs4/doc/ – sehe Jun 28 '20 at 21:06
  • As Said before c++ is a Bad language for this purpose. But to your question you can specify the content you want by the Link you are using. Links contain function Arguments but that is Something Website dependend. to save it or do Something else you have to know what it is and have code which does what you want to happend with that Data Format. – just a guy Jun 28 '20 at 21:32
  • @sehe does it mean, that to work with already done servers, web pages, I will have to use python for example, because on c++ that will be too much to do every time? –  Jun 29 '20 at 04:09

0 Answers0