Spelmann
Erfahrenes Mitglied
Ich hätte nie gedacht dass das so schwierig ist.
Mithilfe von sheel in einem anderem Thread konnte ich endlich die realen Daten zumindest mal abrufen.
Ich bin aber noch immer weit davon entfernt die obigen Beispiele umsetzen zu können.
Weiter als bis zu dieser Fehlermeldung komme ich nicht:
entweder (simpleXML):
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in
oder (DOM):
Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1
Vielleicht beschreibe ich nochmal die derzeitige Ausgangslage:
Die XML Daten werden über eine ReST Schnittstelle bereitgestellt. Um diese Daten zu bekommen, muss man Authentifizierungsdaten im Header mitsenden. Das funktioniert inzwischen:
$cudata = curl_exec($cu); gibt im Quelltext wenn ich die Daten für zwei Fahrzeuge abrufe folgendes aus:
Wenn ihr mich weiter so engagiert unterstützen würdet und mir auf Basis dieser Daten zeigen könntet wie ich für beide Fahrzeuge z.B. Fahrzeugmodell, Felgentyp und Schaltung ausgeben könnte wär das super. Ich komm echt nicht mehr weiter.
Vielen, vielen Dank.
Mithilfe von sheel in einem anderem Thread konnte ich endlich die realen Daten zumindest mal abrufen.
Ich bin aber noch immer weit davon entfernt die obigen Beispiele umsetzen zu können.
Weiter als bis zu dieser Fehlermeldung komme ich nicht:
entweder (simpleXML):
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in
oder (DOM):
Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1
Vielleicht beschreibe ich nochmal die derzeitige Ausgangslage:
Die XML Daten werden über eine ReST Schnittstelle bereitgestellt. Um diese Daten zu bekommen, muss man Authentifizierungsdaten im Header mitsenden. Das funktioniert inzwischen:
PHP:
<?php
$cu = curl_init("https://services.mobile.de/search-api/search?customerNumber=******&page.size=2");
curl_setopt($cu, CURLOPT_HEADER, 0);
curl_setopt($cu, CURLOPT_HTTPHEADER, array(
'Accept: application/xml',
'Authorization: Basic' . base64_encode("********:********"),
'Accept-Language: de'
));
$cudata = curl_exec($cu);
curl_close($cu);
?>
$cudata = curl_exec($cu); gibt im Quelltext wenn ich die Daten für zwei Fahrzeuge abrufe folgendes aus:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MOBILE.de Test</title>
</head>
<body>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><search:search-result xmlns:seller="http://services.mobile.de/schema/seller" xmlns:ad="http://services.mobile.de/schema/ad" xmlns:search="http://services.mobile.de/schema/search" xmlns:financing="http://services.mobile.de/schema/common/financing-1.0" xmlns:resource="http://services.mobile.de/schema/resource" xmlns:error="http://services.mobile.de/schema/common/error-1.0">
<search:total>48</search:total>
<search:page-size>2</search:page-size>
<search:current-page>1</search:current-page>
<search:max-pages>25</search:max-pages>
<search:ads>
<ad:ad key="194142776" url="https://services.mobile.de/search-api/ad/194142776">
<ad:creation-date value="2014-05-14T12:54:24+02:00"/>
<ad:modification-date value="2015-03-14T13:17:18+01:00"/>
<ad:detail-page url="http://suchen.mobile.de/auto-inserat/vw-golf-vi-1-4-tsi-comfortline-beverstedt-ot-lunestedt/194142776.html"/>
<ad:vehicle>
<ad:class key="Car" url="https://services.mobile.de/refdata/classes/Car">
<resource:local-description xml-lang="de">Pkw</resource:local-description>
</ad:class>
<ad:category key="Limousine" url="https://services.mobile.de/refdata/categories/Limousine">
<resource:local-description xml-lang="de">Limousine</resource:local-description>
</ad:category>
<ad:make key="VW" url="https://services.mobile.de/refdata/classes/Car/makes/VW">
<resource:local-description xml-lang="de">Volkswagen</resource:local-description>
</ad:make>
<ad:model key="Golf" url="https://services.mobile.de/refdata/classes/Car/makes/VW/models/Golf">
<resource:local-description xml-lang="de">Golf</resource:local-description>
</ad:model>
<ad:model-description value="Golf VI 1.4 TSI Comfortline"/>
<ad:accident-damaged value="false"/>
<ad:roadworthy value="true"/>
<ad:features url="https://services.mobile.de/refdata/features">
<ad:feature key="METALLIC" url="https://services.mobile.de/refdata/features/METALLIC">
<resource:local-description xml-lang="de">Metallic</resource:local-description>
</ad:feature>
<ad:feature key="ALLOY_WHEELS" url="https://services.mobile.de/refdata/features/ALLOY_WHEELS">
<resource:local-description xml-lang="de">Leichtmetallfelgen</resource:local-description>
</ad:feature>
<ad:feature key="CENTRAL_LOCKING" url="https://services.mobile.de/refdata/features/CENTRAL_LOCKING">
<resource:local-description xml-lang="de">Zentralverriegelung</resource:local-description>
</ad:feature>
<ad:feature key="ELECTRIC_WINDOWS" url="https://services.mobile.de/refdata/features/ELECTRIC_WINDOWS">
<resource:local-description xml-lang="de">Elektr. Fensterheber</resource:local-description>
</ad:feature>
<ad:feature key="IMMOBILIZER" url="https://services.mobile.de/refdata/features/IMMOBILIZER">
<resource:local-description xml-lang="de">Elektr. Wegfahrsperre</resource:local-description>
</ad:feature>
<ad:feature key="POWER_ASSISTED_STEERING" url="https://services.mobile.de/refdata/features/POWER_ASSISTED_STEERING">
<resource:local-description xml-lang="de">Servolenkung</resource:local-description>
</ad:feature>
<ad:feature key="ABS" url="https://services.mobile.de/refdata/features/ABS">
<resource:local-description xml-lang="de">ABS</resource:local-description>
</ad:feature>
<ad:feature key="ESP" url="https://services.mobile.de/refdata/features/ESP">
<resource:local-description xml-lang="de">ESP</resource:local-description>
</ad:feature>
<ad:feature key="FULL_SERVICE_HISTORY" url="https://services.mobile.de/refdata/features/FULL_SERVICE_HISTORY">
<resource:local-description xml-lang="de">Scheckheftgepflegt</resource:local-description>
</ad:feature>
<ad:feature key="E10_ENABLED" url="https://services.mobile.de/refdata/features/E10_ENABLED">
<resource:local-description xml-lang="de">E10-geeignet</resource:local-description>
</ad:feature>
<ad:feature key="HU_AU_NEU" url="https://services.mobile.de/refdata/features/HU_AU_NEU">
<resource:local-description xml-lang="de">HU neu</resource:local-description>
</ad:feature>
<ad:feature key="WARRANTY" url="https://services.mobile.de/refdata/features/WARRANTY">
<resource:local-description xml-lang="de">Garantie</resource:local-description>
</ad:feature>
<ad:feature key="ELECTRIC_EXTERIOR_MIRRORS" url="https://services.mobile.de/refdata/features/ELECTRIC_EXTERIOR_MIRRORS">
<resource:local-description xml-lang="de">Elektr. Seitenspiegel</resource:local-description>
</ad:feature>
<ad:feature key="TUNER" url="https://services.mobile.de/refdata/features/TUNER">
<resource:local-description xml-lang="de">Tuner/Radio</resource:local-description>
</ad:feature>
<ad:feature key="ISOFIX" url="https://services.mobile.de/refdata/features/ISOFIX">
<resource:local-description xml-lang="de">Isofix (Kindersitzbefestigung)</resource:local-description>
</ad:feature>
<ad:feature key="BENDING_LIGHTS" url="https://services.mobile.de/refdata/features/BENDING_LIGHTS">
<resource:local-description xml-lang="de">Kurvenlicht</resource:local-description>
</ad:feature>
<ad:feature key="FRONT_FOG_LIGHTS" url="https://services.mobile.de/refdata/features/FRONT_FOG_LIGHTS">
<resource:local-description xml-lang="de">Nebelscheinwerfer</resource:local-description>
</ad:feature>
<ad:feature key="DAYTIME_RUNNING_LIGHTS" url="https://services.mobile.de/refdata/features/DAYTIME_RUNNING_LIGHTS">
<resource:local-description xml-lang="de">Tagfahrlicht</resource:local-description>
</ad:feature>
<ad:feature key="NONSMOKER_VEHICLE" url="https://services.mobile.de/refdata/features/NONSMOKER_VEHICLE">
<resource:local-description xml-lang="de">Nichtraucher-Fahrzeug</resource:local-description>
</ad:feature>
<ad:feature key="PARKING_SENSORS" url="https://services.mobile.de/refdata/features/PARKING_SENSORS">
<resource:local-description xml-lang="de">Einparkhilfe</resource:local-description>
</ad:feature>
</ad:features>
<ad:specifics>
<ad:exterior-color key="BLUE" url="https://services.mobile.de/refdata/colors/BLUE">
<resource:local-description xml-lang="de">Blau</resource:local-description>
<ad:metalic value="true"/>
<ad:manufacturer-color-name value="Shark Blue Metallic"/>
</ad:exterior-color>
<ad:mileage value="19300"/>
<ad:first-registration value="2009-12"/>
<ad:emission-class key="EURO5" url="https://services.mobile.de/refdata/emissionclasses/EURO5">
<resource:local-description xml-lang="de">Euro5</resource:local-description>
</ad:emission-class>
<ad:emission-fuel-consumption envkv-compliant="false" co2-emission="144.00" inner="8.20" outer="5.10" combined="6.20" unit="LITER_PER_100_KM"/>
<ad:fuel key="PETROL" url="https://services.mobile.de/refdata/fuels/PETROL">
<resource:local-description xml-lang="de">Benzin</resource:local-description>
</ad:fuel>
<ad:power value="90"/>
<ad:gearbox key="MANUAL_GEAR" url="https://services.mobile.de/refdata/gearboxes/MANUAL_GEAR">
<resource:local-description xml-lang="de">Schaltgetriebe</resource:local-description>
</ad:gearbox>
<ad:climatisation key="AUTOMATIC_CLIMATISATION" url="https://services.mobile.de/refdata/climatisations/AUTOMATIC_CLIMATISATION">
<resource:local-description xml-lang="de">Klimaautomatik</resource:local-description>
</ad:climatisation>
<ad:cubic-capacity value="1390"/>
<ad:condition key="USED" url="https://services.mobile.de/refdata/conditions/USED">
<resource:local-description xml-lang="de">Gebrauchtfahrzeug</resource:local-description>
</ad:condition>
<ad:number-of-previous-owners>1</ad:number-of-previous-owners>
</ad:specifics>
</ad:vehicle>
<ad:description></ad:description>
<ad:images count="1" gallery-url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_23.JPG" url="https://services.mobile.de/search-api/ad/194142776/images">
<ad:image>
<ad:representation size="S" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_18.JPG"/>
<ad:representation size="XL" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_27.JPG"/>
<ad:representation size="ICON" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_23.JPG"/>
<ad:representation size="L" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_1.JPG"/>
<ad:representation size="M" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/4aEAAOxywFhTc0wt/$_24.JPG"/>
</ad:image>
</ad:images>
<ad:price currency="EUR" type="FIXED">
<ad:consumer-price-amount value="13890.00"/>
<ad:vatable value="false"/>
</ad:price>
<seller:seller key="453228" url="https://services.mobile.de/search-api/seller/453228">
<seller:type value="DEALER" commercial="true"/>
<seller:address>
<seller:zipcode value="27616"/>
<seller:city value="Beverstedt / OT Lunestedt"/>
<seller:country-code value="DE"/>
</seller:address>
<seller:coordinates>
<seller:latitude>53.440041</seller:latitude>
<seller:longitude>8.734520</seller:longitude>
</seller:coordinates>
</seller:seller>
</ad:ad>
<ad:ad key="194157596" url="https://services.mobile.de/search-api/ad/194157596">
<ad:creation-date value="2014-05-14T17:28:54+02:00"/>
<ad:modification-date value="2014-10-27T08:58:30+01:00"/>
<ad:detail-page url="http://suchen.mobile.de/auto-inserat/vw-jetta-1-2-tsi-match-navigation-rns-315-beverstedt-ot-lunestedt/194157596.html"/>
<ad:vehicle>
<ad:class key="Car" url="https://services.mobile.de/refdata/classes/Car">
<resource:local-description xml-lang="de">Pkw</resource:local-description>
</ad:class>
<ad:category key="Limousine" url="https://services.mobile.de/refdata/categories/Limousine">
<resource:local-description xml-lang="de">Limousine</resource:local-description>
</ad:category>
<ad:make key="VW" url="https://services.mobile.de/refdata/classes/Car/makes/VW">
<resource:local-description xml-lang="de">Volkswagen</resource:local-description>
</ad:make>
<ad:model key="Jetta" url="https://services.mobile.de/refdata/classes/Car/makes/VW/models/Jetta">
<resource:local-description xml-lang="de">Jetta</resource:local-description>
</ad:model>
<ad:model-description value="Jetta 1.2 TSI Match NAVIGATION RNS 315"/>
<ad:accident-damaged value="false"/>
<ad:features url="https://services.mobile.de/refdata/features">
<ad:feature key="METALLIC" url="https://services.mobile.de/refdata/features/METALLIC">
<resource:local-description xml-lang="de">Metallic</resource:local-description>
</ad:feature>
<ad:feature key="ALLOY_WHEELS" url="https://services.mobile.de/refdata/features/ALLOY_WHEELS">
<resource:local-description xml-lang="de">Leichtmetallfelgen</resource:local-description>
</ad:feature>
<ad:feature key="CENTRAL_LOCKING" url="https://services.mobile.de/refdata/features/CENTRAL_LOCKING">
<resource:local-description xml-lang="de">Zentralverriegelung</resource:local-description>
</ad:feature>
<ad:feature key="ELECTRIC_WINDOWS" url="https://services.mobile.de/refdata/features/ELECTRIC_WINDOWS">
<resource:local-description xml-lang="de">Elektr. Fensterheber</resource:local-description>
</ad:feature>
<ad:feature key="IMMOBILIZER" url="https://services.mobile.de/refdata/features/IMMOBILIZER">
<resource:local-description xml-lang="de">Elektr. Wegfahrsperre</resource:local-description>
</ad:feature>
<ad:feature key="POWER_ASSISTED_STEERING" url="https://services.mobile.de/refdata/features/POWER_ASSISTED_STEERING">
<resource:local-description xml-lang="de">Servolenkung</resource:local-description>
</ad:feature>
<ad:feature key="ABS" url="https://services.mobile.de/refdata/features/ABS">
<resource:local-description xml-lang="de">ABS</resource:local-description>
</ad:feature>
<ad:feature key="ESP" url="https://services.mobile.de/refdata/features/ESP">
<resource:local-description xml-lang="de">ESP</resource:local-description>
</ad:feature>
<ad:feature key="NAVIGATION_SYSTEM" url="https://services.mobile.de/refdata/features/NAVIGATION_SYSTEM">
<resource:local-description xml-lang="de">Navigationssystem</resource:local-description>
</ad:feature>
<ad:feature key="FULL_SERVICE_HISTORY" url="https://services.mobile.de/refdata/features/FULL_SERVICE_HISTORY">
<resource:local-description xml-lang="de">Scheckheftgepflegt</resource:local-description>
</ad:feature>
<ad:feature key="ELECTRIC_HEATED_SEATS" url="https://services.mobile.de/refdata/features/ELECTRIC_HEATED_SEATS">
<resource:local-description xml-lang="de">Sitzheizung</resource:local-description>
</ad:feature>
<ad:feature key="E10_ENABLED" url="https://services.mobile.de/refdata/features/E10_ENABLED">
<resource:local-description xml-lang="de">E10-geeignet</resource:local-description>
</ad:feature>
<ad:feature key="HU_AU_NEU" url="https://services.mobile.de/refdata/features/HU_AU_NEU">
<resource:local-description xml-lang="de">HU neu</resource:local-description>
</ad:feature>
<ad:feature key="WARRANTY" url="https://services.mobile.de/refdata/features/WARRANTY">
<resource:local-description xml-lang="de">Garantie</resource:local-description>
</ad:feature>
<ad:feature key="ELECTRIC_EXTERIOR_MIRRORS" url="https://services.mobile.de/refdata/features/ELECTRIC_EXTERIOR_MIRRORS">
<resource:local-description xml-lang="de">Elektr. Seitenspiegel</resource:local-description>
</ad:feature>
<ad:feature key="ON_BOARD_COMPUTER" url="https://services.mobile.de/refdata/features/ON_BOARD_COMPUTER">
<resource:local-description xml-lang="de">Bordcomputer</resource:local-description>
</ad:feature>
<ad:feature key="CD_PLAYER" url="https://services.mobile.de/refdata/features/CD_PLAYER">
<resource:local-description xml-lang="de">CD-Spieler</resource:local-description>
</ad:feature>
<ad:feature key="MP3_INTERFACE" url="https://services.mobile.de/refdata/features/MP3_INTERFACE">
<resource:local-description xml-lang="de">MP3-Schnittstelle</resource:local-description>
</ad:feature>
<ad:feature key="MULTIFUNCTIONAL_WHEEL" url="https://services.mobile.de/refdata/features/MULTIFUNCTIONAL_WHEEL">
<resource:local-description xml-lang="de">Multifunktionslenkrad</resource:local-description>
</ad:feature>
<ad:feature key="TUNER" url="https://services.mobile.de/refdata/features/TUNER">
<resource:local-description xml-lang="de">Tuner/Radio</resource:local-description>
</ad:feature>
<ad:feature key="ISOFIX" url="https://services.mobile.de/refdata/features/ISOFIX">
<resource:local-description xml-lang="de">Isofix (Kindersitzbefestigung)</resource:local-description>
</ad:feature>
<ad:feature key="FRONT_FOG_LIGHTS" url="https://services.mobile.de/refdata/features/FRONT_FOG_LIGHTS">
<resource:local-description xml-lang="de">Nebelscheinwerfer</resource:local-description>
</ad:feature>
<ad:feature key="DAYTIME_RUNNING_LIGHTS" url="https://services.mobile.de/refdata/features/DAYTIME_RUNNING_LIGHTS">
<resource:local-description xml-lang="de">Tagfahrlicht</resource:local-description>
</ad:feature>
<ad:feature key="NONSMOKER_VEHICLE" url="https://services.mobile.de/refdata/features/NONSMOKER_VEHICLE">
<resource:local-description xml-lang="de">Nichtraucher-Fahrzeug</resource:local-description>
</ad:feature>
<ad:feature key="PARKING_SENSORS" url="https://services.mobile.de/refdata/features/PARKING_SENSORS">
<resource:local-description xml-lang="de">Einparkhilfe</resource:local-description>
</ad:feature>
</ad:features>
<ad:specifics>
<ad:exterior-color key="GREY" url="https://services.mobile.de/refdata/colors/GREY">
<resource:local-description xml-lang="de">Grau</resource:local-description>
<ad:metalic value="true"/>
<ad:manufacturer-color-name value="Platinum Grey Metallic"/>
</ad:exterior-color>
<ad:mileage value="16930"/>
<ad:first-registration value="2012-08"/>
<ad:emission-class key="EURO5" url="https://services.mobile.de/refdata/emissionclasses/EURO5">
<resource:local-description xml-lang="de">Euro5</resource:local-description>
</ad:emission-class>
<ad:emission-fuel-consumption envkv-compliant="false" co2-emission="134.00" inner="7.10" outer="4.90" combined="5.70" unit="LITER_PER_100_KM"/>
<ad:fuel key="PETROL" url="https://services.mobile.de/refdata/fuels/PETROL">
<resource:local-description xml-lang="de">Benzin</resource:local-description>
</ad:fuel>
<ad:power value="77"/>
<ad:gearbox key="MANUAL_GEAR" url="https://services.mobile.de/refdata/gearboxes/MANUAL_GEAR">
<resource:local-description xml-lang="de">Schaltgetriebe</resource:local-description>
</ad:gearbox>
<ad:climatisation key="AUTOMATIC_CLIMATISATION" url="https://services.mobile.de/refdata/climatisations/AUTOMATIC_CLIMATISATION">
<resource:local-description xml-lang="de">Klimaautomatik</resource:local-description>
</ad:climatisation>
<ad:cubic-capacity value="1197"/>
<ad:condition key="USED" url="https://services.mobile.de/refdata/conditions/USED">
<resource:local-description xml-lang="de">Gebrauchtfahrzeug</resource:local-description>
</ad:condition>
<ad:number-of-previous-owners>1</ad:number-of-previous-owners>
</ad:specifics>
</ad:vehicle>
<ad:description></ad:description>
<ad:images count="1" gallery-url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_23.JPG" url="https://services.mobile.de/search-api/ad/194157596/images">
<ad:image>
<ad:representation size="S" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_18.JPG"/>
<ad:representation size="XL" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_27.JPG"/>
<ad:representation size="ICON" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_23.JPG"/>
<ad:representation size="L" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_1.JPG"/>
<ad:representation size="M" url="http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/5dYAAOxyZzlTc4xP/$_24.JPG"/>
</ad:image>
</ad:images>
<ad:price currency="EUR" type="FIXED">
<ad:consumer-price-amount value="16950.00"/>
<ad:vatable value="true"/>
<ad:vat-rate value="0.1900"/>
</ad:price>
<seller:seller key="453228" url="https://services.mobile.de/search-api/seller/453228">
<seller:type value="DEALER" commercial="true"/>
<seller:address>
<seller:zipcode value="27616"/>
<seller:city value="Beverstedt / OT Lunestedt"/>
<seller:country-code value="DE"/>
</seller:address>
<seller:coordinates>
<seller:latitude>53.440041</seller:latitude>
<seller:longitude>8.734520</seller:longitude>
</seller:coordinates>
</seller:seller>
</ad:ad>
</search:ads>
</search:search-result>
<h1>Ausgabe</h1>
</body>
</html>
Wenn ihr mich weiter so engagiert unterstützen würdet und mir auf Basis dieser Daten zeigen könntet wie ich für beide Fahrzeuge z.B. Fahrzeugmodell, Felgentyp und Schaltung ausgeben könnte wär das super. Ich komm echt nicht mehr weiter.
Vielen, vielen Dank.