Skip to content

Commit

Permalink
Small tweak for new DHL DOM changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sauladam committed Mar 3, 2018
1 parent a5740e7 commit c6fc032
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Trackers/DHL.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function getTrack(DOMXPath $xpath)
*/
protected function termDescriptionPairs(DOMXPath $xpath)
{
$descriptionList = $xpath->query("//div[@id='events-content']//dl");
$descriptionList = $xpath->query("//div[@id='events-content-0']//dl");

if (!$descriptionList || $descriptionList->length === 0) {
throw new \Exception("Unable to parse DHL tracking data for [{$this->parcelNumber}].");
Expand All @@ -91,11 +91,11 @@ protected function termDescriptionPairs(DOMXPath $xpath)
$terms = [];
$descriptions = [];

foreach ($xpath->query("//div[@id='events-content']//dl//dt") as $term) {
foreach ($xpath->query("//div[@id='events-content-0']//dl//dt") as $term) {
$terms[] = $this->getNodeValue($term);
}

foreach ($xpath->query("//div[@id='events-content']//dl//dd") as $description) {
foreach ($xpath->query("//div[@id='events-content-0']//dl//dd") as $description) {
$descriptions[] = $this->getNodeValue($description);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/DHL/delivered.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
</div>
</div>
</a>
<div id="events-content"
<div id="events-content-0"
class="panel-collapse collapse in"
role="tabpanel" aria-labelledby="events-heading">

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/DHL/exception.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
</div>
</div>
</a>
<div id="events-content"
<div id="events-content-0"
class="panel-collapse collapse in"
role="tabpanel" aria-labelledby="events-heading">

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/DHL/in_transit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
</div>
</div>
</a>
<div id="events-content"
<div id="events-content-0"
class="panel-collapse collapse in"
role="tabpanel" aria-labelledby="events-heading">

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/DHL/pickup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
</div>
</div>
</a>
<div id="events-content"
<div id="events-content-0"
class="panel-collapse collapse in"
role="tabpanel" aria-labelledby="events-heading">

Expand Down

0 comments on commit c6fc032

Please sign in to comment.