HTTPMOD, ich bekomme keine Readings

Begonnen von buzzmain, 12 September 2019, 16:11:28

Vorheriges Thema - Nächstes Thema

buzzmain

Hallo Ihr Lieben,

ich versuche aus der Webseite https://www.transfermarkt.de/2-bundesliga/tabelle/wettbewerb/L2 die aktuelle Ligatabelle auszulesen.

Hierfür habe ich dies gebaut:

defmod bundesligaTabelle HTTPMOD http://www.transfermarkt.de/2-bundesliga/tabelle/wettbewerb/L2 120
attr bundesligaTabelle userattr reading01Name reading01Regex reading02Name reading02Regex
attr bundesligaTabelle enableControlSet 1
attr bundesligaTabelle enableCookies 1
attr bundesligaTabelle enforceGoodReadingNames 1
attr bundesligaTabelle handleRedirects 1
attr bundesligaTabelle reading01Name platz01Verein
attr bundesligaTabelle reading01Regex class="rechts hauptlink">1.*span><.td>\n.*alt="(.*)" class
attr bundesligaTabelle reading02Name platz02Verein
attr bundesligaTabelle reading02Regex class="rechts hauptlink">2.*span><.td>\n.*alt="(.*)" class
attr bundesligaTabelle room System
attr bundesligaTabelle userReadings reading01Name reading01Regex reading02Name reading02Regex


Den Regex-String habe ich mit mit der https://regex101.com/ seite geprüft und liefert die Namen der Vereine.

Hier ein Codestück von der Webseite:

<tr>
<td style="background-color:#afd179" class="rechts hauptlink">2<span title="Vorwoche 3.Platz" class="icons_sprite green-arrow-ten">&nbsp;</span></td>
<td class="zentriert no-border-rechts"><a class="vereinprofil_tooltip" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplan/verein/79/saison_id/2019"><img src="./2. Bundesliga - Tabelle _ Transfermarkt_files/79.png" title=" " alt="VfB Stuttgart" class="tiny_wappen"></a></td>
<td class="no-border-links hauptlink">
<a class="vereinprofil_tooltip" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplan/verein/79/saison_id/2019">VfB Stuttgart</a> <span title="Abstieg aus der 1.Liga 18/19" class="icons_sprite icon-absteiger">&nbsp;</span> </td>
<td class="zentriert"><a title="VfB Stuttgart" class="" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplandatum/verein/79/saison_id/2019/wettbewerb_id/L2">5</a></td>
<td class="zentriert"><a title="VfB Stuttgart" class="" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplandatum/verein/79/saison_id/2019/wettbewerb_id/L2/punkte/3">3</a></td>
<td class="zentriert"><a title="VfB Stuttgart" class="" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplandatum/verein/79/saison_id/2019/wettbewerb_id/L2/punkte/1">2</a></td>
<td class="zentriert"><a title="VfB Stuttgart" class="" id="79" href="https://www.transfermarkt.de/vfb-stuttgart/spielplandatum/verein/79/saison_id/2019/wettbewerb_id/L2/punkte/0">0</a></td>
<td class="zentriert">8:5</td>
<td class="zentriert">3</td>
<td class="zentriert">11</td>
</tr>


Wie bekomme ich jetzt die Readings?


... And on the 8th Day God Created The Homeautomation.

amenomade

Vermutlich kommt es aus deinem "\n" in der Regex. Mach lieber
(?s)class="rechts hauptlink">2.*?span><.td>.*?alt="(.*?)" class
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

buzzmain

DANKE!!!

@amenomade
Das wars. Jetzt geht es.

Falls Interesse besteht werde ich (wenn ich fertig bin) ein Codeschnipsel bezüglich einer Bundesligatabelle für TabletUI hier einstellen.

Ansonsten trotzdem ersteinemal Danbke für Deine Hilfe
... And on the 8th Day God Created The Homeautomation.

buzzmain

... And on the 8th Day God Created The Homeautomation.