How can I get several values on a website using PHP (the value between div tags, value1, value2, value3 in the example below)?

I have been looking into DOMDocument, but getting confused.

Also, will it be possible to get the values without loading the website 3 times?

Example.
I need to get 3 values (or more) from a website:

```
<div class="SomeUniqueClassName">value1</div>
<div class="AnotherUniqueClassName">value2</div>
<div class="UniqueClassName">value3</div>

```

This is what I have now, but it looks stupid and i'm not 100% sure what i'm doing:

```
$doc = new DOMDocument;

$doc->loadHTMLFile($url);

$xpath = new DOMXPath($doc);

$query1 = "//div[@class='SomeUniqueClassName']";
$query2 = "//div[@class='AnotherUniqueClassName']";
$query3 = "//div[@class='UniqueClassName']";

$entry1 = $xpath->query($query1);
$value 1 = var_dump($entry1->item(0)->textContent);

$entry2 = $xpath->query($query2);
$value 2 = var_dump($entry2->item(0)->textContent);

$entry3 = $xpath->query($query3);
$value 3 = var_dump($entry3->item(0)->textContent);

```