Does the $div variable contain a reference to the correct div in your if statement? I often find it helpful to use var_dump() on objects which are coming from things like this, as it lets you know what child objects, etc, it contains, and gives you and idea of how you can reference them. I've not used DOMDocument myself, but I would imagine that you could get the link object with:
$a = $div->getElementsByTagName('a');
but I'm sure there's a more efficient and better way of doing this.