Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Ist es möglich mit Hilfe von C++ auf den HTML-Code zuzugreifen, diesen nach bestimmten Kriterien zu durchsuchen und mit den gefunden Inhalten weiterzuarbeiten? Ich möchte ein Programm schreiben, das in der Lage ist von unterschiedlichen Seiten, die aber gleich aufgebaut sind, bestimmte Werte einzulesen und ins Programm zu übertragen (z.B. Aktienkurse o. ä.).

Ich hoffe es kann mir jemand bei diesem Problem weiterhelfen.

hier gibts ein demoprojekt, damit kannst du beliebige html-seiten in string

runterladen und dann entsprechend verarbeiten.

the code project

viel vergnügen ...

Ciao TinTin

  • 5 Wochen später...

Hallo,

Diese Methode lädt die angegebene Seite (sUrl) und speichert den HTML-Text auf die Festplatte mit Namen "provider_page.txt" Nun kannst du die Datei ganz normal untersuchen mit den String-Funktionen wie

GetLength()

Find()

Mid()

etc....

Viel Spaß & Ciao!





int CCallStockValue::ConnectAndReadPage(CString sUrl, CString &sPageText)

{

  CInternetSession netSession;

  CString sMessage;

  CStdioFile* pFile;

  CFile OutFile;

  int iStatus = -1;

  int iBytes; // Count of readed bytes

  char sBuffer[1024]; // Buffer 

  CCallStockValue c;  // GetApplicationDir()



  // Open the html site

  if (sUrl == "")

  {

    sMessage = sMessage + "URL is missing!   \n";

    AfxMessageBox(sMessage, MB_ICONINFORMATION);    

  }

  else

  {    

    pFile = netSession.OpenURL(sUrl);

    if (pFile == NULL)

    {

      // Connection is incorrect

      sMessage = sMessage + "\nConnection the data-provider\n\n" + sUrl + "\n\n" +

                            "was failed!\n\n";

      AfxMessageBox(sMessage, MB_ICONSTOP);

    }

    else

    {

      // Open/create local file on hdd at application directory

      // to store page


      OutFile.Open(c.GetApplicationDir() + "provider_page.txt", 

        CFile::modeCreate | 

        CFile::modeWrite);


      // Connection is ok, then read html and write to hdd

      while ((iBytes = pFile->Read(sBuffer, sizeof(sBuffer))) > 0)

      {

        sPageText += sBuffer;

        OutFile.Write(sBuffer, iBytes);         

      }


      // Close CStdioFile (pFile)

      delete pFile;

      // Close file (CFile)

      OutFile.Close();


      // Close net session 

      netSession.Close();


      // Status is OK

      iStatus = 1; // 

    }

  }


  return iStatus;

}

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.