c++ - How can i get content of web-page -


I'm trying to get web-page data in the string, instead I can parse it. I did not find any way in qwebview, qurl and other can you help me? Linux, C ++, Qt.

Edit:

Thanks code is working for help, but after downloading some pages have broken the pigment. Tried to do something like this:

  QNetworkRequest * request = new QNetworkRequest (QUrl ("http://ru.wiktionary.org/wiki/bovo")); Request-> Setraheader ("user-agent", "Mozilla / 5.0 (X11; U; Linux i686 (x86_64);" "N-US; RV .: 1.9.0.1) Gecko / 2008070206 Firefox / 3.0.1"); Request-> Setraheader ("accept-charset", "win 1251, utf-8; q = 0.7, *; q = 0.7"); Request-> Setrahead ("charset", "UTF-8"); Request-> Setrohoder ("Connection", "Keep-alive"); Manager & gt; (* Request) is received;  

Any result = (.

have you seen ? Here is a rough and ready sample to use:

  class MyClass: public QObject {Q_OBJECT public: MyClass (); get zero; Public slot: Answer to zero (QNetworkReply *); Personal: QNetworkAccessManager * M_manager;}; MyClass :: MyClass () {m_manager = New QNetworkAccessManager (this); Connect (M_Manager, Signal (Finish (QN Network * *), Slot (maximum (QN NetworkCorp *) ));} Shu New MyClass :: Fetch () {m_manager- & gt; Get (QNetworkRequest (QUrl ("http://stackoverflow.com"))} Zero MyClass :: replyFinished (QNetworkReply * pReply) {QByteArray data = pReply- & Gt; readAll (); Qstring str (data); // process str any way you!}  

In your handler for the signal, you will pass an object, which will be sent to you You can read the feedback from the form as it is inherited from. An easy way to do this is to call j to get one. You can build one with that QByteArray and do whatever you do with it. Do not want to.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -