<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HTML aus-&#x2F;einlesen - ich komme nicht weiter]]></title><description><![CDATA[<p>Hallo!</p>
<p>Nachdem ich tagelang das gesamte INet durchsucht habe, poste ich jatzt mal hier eine Frage....</p>
<p>Ich möchte für meine G15 (Tastatur mit LCD) ein Applet in C++ schreiben, das verschiedene Links parst und gesuchte Infos darstellt. Z.B. Heise-News, Sport-Ergebnisse oder eBay-Artikel.<br />
Das Ganze ist für mich der Einstieg in C++ (Java ist kein Problem).</p>
<p>Mit Hilfe in einem G15-Forum bin ich auch schon auf Code gekommen:</p>
<pre><code>string htmlContent; // Speicher fr den Dateiinhalt

   wstring l_urlAlsWString = convertStringToWstring(p_url);
   LPCTSTR url(l_urlAlsWString.c_str());
   LPCTSTR tmpFile = TEXT( &quot;index.html&quot; );
   HRESULT tmpRes = URLDownloadToFile(NULL, url, tmpFile, 0, NULL );

   if( tmpRes == S_OK ) {
      cout &lt;&lt; &quot;Datei wurde geladen.&quot; &lt;&lt; endl;
      string dateiname = &quot;index.html&quot;;
      ifstream fin;
      fin.open( dateiname.c_str(), ios_base::in );
      if( !fin ) {
         // Falls beim ffnen ein Fehler augetreten ist :
         cout &lt;&lt; &quot;Datei konnte nicht gelesen werden&quot; &lt;&lt; endl;
      } else {
         char c; // temporrer Speicher fr einzelne Zeichen
         while( !fin.eof() ) {
            fin.get( c ); // ein zeichen vom Stream (Datei) lesen
            htmlContent += c; // und an den Inhalt hngen
         }
         fin.close(); // Datei schliessen
      }
   }

   return htmlContent;
</code></pre>
<p>Mein Problem ist, daß ich zum einen dort noch Sonderzeichen anstatt von Umlauten habe (eigentlich auch à statt SPACE, was aber wohl an meiner Testumgebung gelegen hat) und vor allem, daß dder Code anscheinend eine URL mit '.htm(l)' braucht. <a href="http://www.heise.de" rel="nofollow">www.heise.de</a> z.B. funktionieren nicht.</p>
<p>Kann mir jemand dabei helfen?!<br />
Es kann auch alternativer Code sein. Wichtig ist nur, daß ich Visual Studio C++ Express benutze und daher keine MFC benutzen kann.</p>
<p>THX! *hoffnungsvoll*</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181170/html-aus-einlesen-ich-komme-nicht-weiter</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 05:44:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181170.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 May 2007 16:52:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Thu, 10 May 2007 16:52:34 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Nachdem ich tagelang das gesamte INet durchsucht habe, poste ich jatzt mal hier eine Frage....</p>
<p>Ich möchte für meine G15 (Tastatur mit LCD) ein Applet in C++ schreiben, das verschiedene Links parst und gesuchte Infos darstellt. Z.B. Heise-News, Sport-Ergebnisse oder eBay-Artikel.<br />
Das Ganze ist für mich der Einstieg in C++ (Java ist kein Problem).</p>
<p>Mit Hilfe in einem G15-Forum bin ich auch schon auf Code gekommen:</p>
<pre><code>string htmlContent; // Speicher fr den Dateiinhalt

   wstring l_urlAlsWString = convertStringToWstring(p_url);
   LPCTSTR url(l_urlAlsWString.c_str());
   LPCTSTR tmpFile = TEXT( &quot;index.html&quot; );
   HRESULT tmpRes = URLDownloadToFile(NULL, url, tmpFile, 0, NULL );

   if( tmpRes == S_OK ) {
      cout &lt;&lt; &quot;Datei wurde geladen.&quot; &lt;&lt; endl;
      string dateiname = &quot;index.html&quot;;
      ifstream fin;
      fin.open( dateiname.c_str(), ios_base::in );
      if( !fin ) {
         // Falls beim ffnen ein Fehler augetreten ist :
         cout &lt;&lt; &quot;Datei konnte nicht gelesen werden&quot; &lt;&lt; endl;
      } else {
         char c; // temporrer Speicher fr einzelne Zeichen
         while( !fin.eof() ) {
            fin.get( c ); // ein zeichen vom Stream (Datei) lesen
            htmlContent += c; // und an den Inhalt hngen
         }
         fin.close(); // Datei schliessen
      }
   }

   return htmlContent;
</code></pre>
<p>Mein Problem ist, daß ich zum einen dort noch Sonderzeichen anstatt von Umlauten habe (eigentlich auch à statt SPACE, was aber wohl an meiner Testumgebung gelegen hat) und vor allem, daß dder Code anscheinend eine URL mit '.htm(l)' braucht. <a href="http://www.heise.de" rel="nofollow">www.heise.de</a> z.B. funktionieren nicht.</p>
<p>Kann mir jemand dabei helfen?!<br />
Es kann auch alternativer Code sein. Wichtig ist nur, daß ich Visual Studio C++ Express benutze und daher keine MFC benutzen kann.</p>
<p>THX! *hoffnungsvoll*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282531</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 10 May 2007 16:52:34 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Thu, 10 May 2007 17:24:30 GMT]]></title><description><![CDATA[<p>Da ist immer ein index.htm(l) dahinter.<br />
<a href="http://www.heise.de/index.html" rel="nofollow">http://www.heise.de/index.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282543</guid><dc:creator><![CDATA[LadySchäfer]]></dc:creator><pubDate>Thu, 10 May 2007 17:24:30 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 07:38:23 GMT]]></title><description><![CDATA[<blockquote>
<p>Da ist immer ein index.htm(l) dahinter.</p>
</blockquote>
<p>Ist es leider nicht. Wenn die Seiten per bsw. php zusammengebaut werden, dann funktioniert ein Anhängen von '.html' z.B. nicht und einen Link auf einen eBay-Artikel kann man damit auch nicht lesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282582</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 11 May 2007 07:38:23 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 07:38:36 GMT]]></title><description><![CDATA[<p>Hat denn keine eine Lösung?! Es muß doch jemanden geben, der sich Daten aus dem INet besorgt?!? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282804</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 11 May 2007 07:38:36 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 08:14:04 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-8.html" rel="nofollow">Rund um die Programmierung</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282830</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 11 May 2007 08:14:04 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 10:51:16 GMT]]></title><description><![CDATA[<p><a href="http://www.heise.de" rel="nofollow">www.heise.de</a> geht nicht aber <a href="http://www.heise.de" rel="nofollow">http://www.heise.de</a> geht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282922</guid><dc:creator><![CDATA[stimmt]]></dc:creator><pubDate>Fri, 11 May 2007 10:51:16 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 13:26:33 GMT]]></title><description><![CDATA[<p>So, nicht persönlich nehmen!</p>
<p>- Heise antwortet an der Stelle kein php, zumindest nicht mit den damit oftmals verbundenen Eigenheiten der URL<br />
- <a href="http://www.heise.de" rel="nofollow">http://www.heise.de</a> geht NICHT:</p>
<blockquote>
<p>Fehler beim Lesen der Datei:-2147221020</p>
</blockquote>
<p>Evtl. klappt das mal, weil der Browser mein, ein index.html dranhängen zu mnüssen, aber auch das ist wohl eher unwahrscheinlich, weil den Job normalerweise der Server übernimmt.</p>
<p>Un mit eBay-Artikeln gehts bsw. erstrechtr nicht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1283017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1283017</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 11 May 2007 13:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 14:19:10 GMT]]></title><description><![CDATA[<p>evtl. kann die libcurl das: <a href="http://curl.haxx.se/" rel="nofollow">http://curl.haxx.se/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1283045</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1283045</guid><dc:creator><![CDATA[Blue-Tiger]]></dc:creator><pubDate>Fri, 11 May 2007 14:19:10 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 14:27:02 GMT]]></title><description><![CDATA[<p>teste mal bei dir</p>
<pre><code class="language-cpp">std::cout &lt;&lt; URLDownloadToFile(NULL, L&quot;http://www.heise.de&quot;, L&quot;C:\\index.html&quot;, 0, NULL);
</code></pre>
<p>bei mir funzt das (0 wird ausgegeben und Datei hat den richtigen Inhalt)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1283051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1283051</guid><dc:creator><![CDATA[stimmt]]></dc:creator><pubDate>Fri, 11 May 2007 14:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 18:51:26 GMT]]></title><description><![CDATA[<p>Hmmm, bei mir kommt nur:<br />
-2147221020.</p>
<p>Das kenne ich irgendwie! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>------------</p>
<p>cURL habe ich auch schon gesehen, bin dazu aber scheinbar zu dämlich. Ohne Beispielcode komme ich da definitiv nicht weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1283194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1283194</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 11 May 2007 18:51:26 GMT</pubDate></item><item><title><![CDATA[Reply to HTML aus-&#x2F;einlesen - ich komme nicht weiter on Fri, 11 May 2007 20:24:23 GMT]]></title><description><![CDATA[<p>So, jetzt mal etwas neues.... dieses Thema habe ich dank des Sockets-Tutorials erledigt.<br />
Ich habe aber jetzt herausgefunden, dass meine Daten anscheind mit Codepage 437 geschrieben wird. Deshalb habe ich bei eBay bsw. 'A0' anstelle eines ' ' an einigen Stellen stehen.<br />
Ich habe im Moment ein Brett vor dem Kopf (das mit dem Suchen hier im Forum immer breiter wird': Wie bekomme ich denn jetzt die Sonderzeichen weg, sprich ISO 8859-1 gesetzt (das steht in der HTML)?!?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1283237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1283237</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 11 May 2007 20:24:23 GMT</pubDate></item></channel></rss>