Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Einsteigerfragen
    4. [erledigt] Parser Goldpreis passt nicht

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [erledigt] Parser Goldpreis passt nicht

    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      exmerci @Cinimod last edited by

      @cinimod Ich weiss, Leiche. Aber ich wollte nicht extra ein neues Thema aufmachen.

      Kannst du mir sagen, falls du hier noch tätig bist, was falsch war und wie es richtig sein muss? Das wäre super.

      Homoran Cinimod 2 Replies Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @exmerci last edited by

        @exmerci sagte in [erledigt] Parser Goldpreis passt nicht:

        Ich weiss, Leiche. Aber ich wollte nicht extra ein neues Thema aufmachen.

        keine gute Idee, zumal als [erledigt] gekennzeichnet

        Allerdings hätte @cinimod auch die Lösung posten können.

        Wie sieht denn der Quelltext der Seite aus?
        bittein code-tags und ggf. Spoiler posten.

        Cinimod 1 Reply Last reply Reply Quote 0
        • Cinimod
          Cinimod Most Active @exmerci last edited by

          @exmerci Ich parse aktuell den Goldpreis nicht mehr, und ich habe mich auch nie richtig in das Thema eingefunden ... so aus dem stehgreif kann ich dir jetzt nicht sagen was falsch war.
          Kann natürlich auch sein das die Seite sich zwischenzeitlich verändert hat. vielleicht zeigst du mal was du hast.

          1 Reply Last reply Reply Quote 0
          • Cinimod
            Cinimod Most Active @Homoran last edited by Cinimod

            @homoran

            <article class="page-content__item page-content__item--space">
            	<h2 class="headline headline--h4">Gold kaufen</h2>
            	<div>
            		<img class="img float-end margin-end-0.25" src="https://images.finanzen.net/images/b_rohstoffe/gold_icon.gif" alt="Gold kaufen" width="50" height="64" loading="lazy">
            		<p>Sie m&ouml;chten in physisches Gold investieren? Nutzen Sie die g&uuml;nstigen Konditionen im finanzen.net Goldshop. Hier bekommen Sie erstklassige Qualit&auml;t und versicherten Versand.</p>
            	</div>
            	<a class="button button--success button--stretch" href="https://www.finanzen.net/ratgeber/gold-kaufen/" target="_blank" rel="nofollow noopener">zum Shop</a>
            </article><article class="page-content__item page-content__item--space"><div itemscope itemtype="http://schema.org/Table">
            	<h2 class="headline headline--h4" itemprop="about">Goldkurs - Goldpreis in Euro</h2>
            	<div class="horizontal-scrolling">
            		<table class="table table--headline-first-col table--content-right">
            			<thead class="table__thead">
            				<tr class="table__tr">
            					<th class="table__th">Zeitraum</th>
            					<th class="table__th">In Euro</th>
            					<th class="table__th">In Dollar</th>
            				</tr>
            			</thead>
            			<tbody class="table__tbody">
            				<tr class="table__tr">
            					<td class="table__td">Aktueller Kurs</td>
            					<td class="table__td">2.808,38</td>
            					<td class="table__td">2.919,62</td>
            				</tr>
            				<tr class="table__tr">
            					<td class="table__td">Er&ouml;ffnung</td>
            					<td class="table__td"></td>
            					<td class="table__td">2.905,28</td>
            				</tr>
            				<tr class="table__tr">
            

            Die 2.808,38 ist der Kurs in Euro

            oder hier stehen die auch noch mal:

               	<div class="snapshot__ad"></div>
            
               	
               			<div class="snapshot__values">
               				<span id="snapshot-value-fst-current-0" class="snapshot__value-current realtime-push">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-no-state-update
               						  data-sg-realtime-push-start-listener="true">
               						2.919,62
               					</span>
               					<span class="snapshot__value-unit">USD</span>
               				</span>
               				<span id="snapshot-value-fst-absolute-0" class="snapshot__value-absolute realtime-push realtime-push--state-positive">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-start-listener="true">
               						+15,86
               					</span>
               					<span class="snapshot__value-unit">USD</span>
               				</span>
               				<span id="snapshot-value-fst-relative-0" class="snapshot__value-relative realtime-push realtime-push--state-positive">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-start-listener="true">
               						+0,55
               					</span>
               					<span class="snapshot__value-unit">%</span>
               				</span>
               			</div>
               			<div class="snapshot__source">
               				<span class="snapshot__source-info"></span>
               				<time class="snapshot__time" datetime="2025-02-13T13:37:00">13:37</time>
               				<span class="snapshot__exchange"></span>
               			</div>
               			<div class="snapshot__values-second">
               				<span id="snapshot-value-fst-current-1" class="snapshot__value-current realtime-push">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-no-state-update
               						  data-sg-realtime-push-start-listener="true">
               						2.808,38
               					</span>
               					<span class="snapshot__value-unit">EUR</span>
               				</span>
               				<span id="snapshot-value-fst-absolute-1" class="snapshot__value-absolute realtime-push realtime-push--state-positive">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-start-listener="true">
               						+12,35
               					</span>
               					<span class="snapshot__value-unit">EUR</span>
               				</span>
               				<span id="snapshot-value-fst-relative-1" class="snapshot__value-relative realtime-push realtime-push--state-positive">
               					<span class="snapshot__value"
               						  data-sg-realtime-push
               						  data-sg-realtime-push-start-listener="true">
               						+0,44
               					</span>
               					<span class="snapshot__value-unit">%</span>
               				</span>
               			</div>
               			<div class="snapshot__source-second">
               				<span class="snapshot__source-info"></span>
               				<time class="snapshot__time" datetime="2025-02-13T13:37:00">13:37</time>
               				<span class="snapshot__exchange"></span>
               			</div>
            

            mir ist das auch zu hoch mit dem regex zeug ...

            der ganze Quelltext lässt sich leider nicht rein kopieren sind mehr als 100k Zeichen oder sowas hat er gemeckert.

            Ich hab es hier mit versucht:

            (\d+.\d+\,\d+)
            

            ergibt aber 154 Treffer ... ist vermutlich dann nicht von langer Dauer.
            Der Quelltext ist von der oben angegebenen Website... der richtige treffer ist in meinem fall die 8

            Homoran 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators @Cinimod last edited by

              @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

              ergibt aber 154 Treffer ... ist vermutlich dann nicht von langer Dauer.

              Deswegen muss man alles sehen um ein eindeutiges RegEx zu erstellen.

              Wie war der aktuelle Wert beim Auszug des Quelltextes?

              Cinimod 1 Reply Last reply Reply Quote 0
              • Cinimod
                Cinimod Most Active @Homoran last edited by Cinimod

                @homoran ja darin liegt ja die schwierigkeit 😊
                2.808,38

                Dann brauchst du nen größeren ausschnitt oder zwingend den gesamten Quelltext?

                Homoran E 3 Replies Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @Cinimod last edited by

                  @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

                  @homoran ja darin liegt ja die schwierigkeit 😊
                  2.808,38

                  Dann brauchst du nen größeren ausschnitt oder zwingend den gesamten Quelltext?

                  hab in der Zwischenzeit jetzt mit 2909... versucht
                  me-push-no[^\d]+([\d.,]+)

                  stay tuned

                  1 Reply Last reply Reply Quote 0
                  • Homoran
                    Homoran Global Moderator Administrators @Cinimod last edited by

                    @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

                    2808,38

                    der ist auf der Seite nicht zu sehen

                    Cinimod 1 Reply Last reply Reply Quote 0
                    • Cinimod
                      Cinimod Most Active @Homoran last edited by

                      @homoran Das war aus dem Auszug als ich dir den Quelltext in dem Spoiler geschickt hatte. aber in €

                      Homoran 2 Replies Last reply Reply Quote 0
                      • Homoran
                        Homoran Global Moderator Administrators @Cinimod last edited by

                        @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

                        @homoran Das war aus dem Auszug als ich dir den Quelltext in dem Spoiler geschickt hatte. aber in €

                        alkes gut, habs gerade gesehen als2.808,38

                        Cinimod 1 Reply Last reply Reply Quote 0
                        • E
                          exmerci @Cinimod last edited by

                          Wow. So viele Antworten in so kurzer Zeit. Das muss ich mir erstmal durchlesen.
                          Ehrlich gesagt beschäftige ich mich heute das erste mal mit dem Parser und RegEx.
                          Nehmen wollte ich den Wert von hier: https://www.goldpreis.de/
                          Gibt aber auch eine Menge andere Seiten.
                          Danke erstmal an alle. Ich habe gedacht das @Cinimod es noch laufen hat und mir eine kurze Lösung geben könnte, damit ich nicht extra RegEx wegen eines Wertes lernen müsste. Aber wenn's so ist, sei's drum.

                          1 Reply Last reply Reply Quote 0
                          • Cinimod
                            Cinimod Most Active @Homoran last edited by

                            @homoran

                            Perfekt so geht es! Dennnoch werd ich wohl nie vestehen wie es geht 🤔

                            Homoran 1 Reply Last reply Reply Quote 0
                            • Homoran
                              Homoran Global Moderator Administrators @Cinimod last edited by

                              @cinimod -no-[^\d]+([\d.,]+)[^i]+it"\>E

                              probiers mal.

                              E Cinimod 2 Replies Last reply Reply Quote 0
                              • Homoran
                                Homoran Global Moderator Administrators last edited by

                                Da ist allerdings ein Tausendertrennzeichen drin.
                                Das sollte in der aktuellen Version des Adapters abgefangen werdrn.

                                Klappt das?

                                1 Reply Last reply Reply Quote 0
                                • E
                                  exmerci @Homoran last edited by

                                  @homoran sagte in [erledigt] Parser Goldpreis passt nicht:

                                  -no-[^\d]+([\d.,]+)[^i]+it">E

                                  Ist das jetzt von dieser URL: https://www.finanzen.net/rohstoffe/goldpreis ?

                                  Homoran Cinimod 2 Replies Last reply Reply Quote 0
                                  • Homoran
                                    Homoran Global Moderator Administrators @exmerci last edited by

                                    @exmerci sagte in [erledigt] Parser Goldpreis passt nicht:

                                    Ist das jetzt von dieser URL:

                                    keine Ahnung!
                                    das ist für xen Quelltext der hier vorhin gepostet wurde

                                    1 Reply Last reply Reply Quote 0
                                    • Homoran
                                      Homoran Global Moderator Administrators @Cinimod last edited by

                                      @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

                                      Dennnoch werd ich wohl nie vestehen wie es geht

                                      Screenshot_20250213-150210_Firefox.jpg

                                      noch Fragen?

                                      1 Reply Last reply Reply Quote 0
                                      • Cinimod
                                        Cinimod Most Active @exmerci last edited by

                                        @exmerci sagte in [erledigt] Parser Goldpreis passt nicht:

                                        @homoran sagte in [erledigt] Parser Goldpreis passt nicht:

                                        -no-[^\d]+([\d.,]+)[^i]+it">E

                                        Ist das jetzt von dieser URL: https://www.finanzen.net/rohstoffe/goldpreis ?

                                        Ja das ist es !

                                        1 Reply Last reply Reply Quote 0
                                        • Cinimod
                                          Cinimod Most Active @Homoran last edited by

                                          @homoran sagte in [erledigt] Parser Goldpreis passt nicht:

                                          -no-[^\d]+([\d.,]+)[^i]+it">E

                                          Passt perfekt, nur ein treffer 👌

                                          Homoran 1 Reply Last reply Reply Quote 0
                                          • Homoran
                                            Homoran Global Moderator Administrators @Cinimod last edited by

                                            @cinimod sagte in [erledigt] Parser Goldpreis passt nicht:

                                            nur ein treffer

                                            das ist ja Sinn der Sache!

                                            Was kann ich dir da noch erklären?

                                            Cinimod E 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            949
                                            Online

                                            31.6k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            3
                                            25
                                            773
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo