Code (PHP) pasted on 2019-03-01, 21:02 Raw Source
- <?php
- foreach ($stocks as $isin => $stock) {
- $platform = $stock['platforms'][$platformKey];
- $uri = $platform['uri'];
- $documentSource = crawlDocument($uri);
- $document = openDocument($documentSource);
- $xpath = new DOMXPath($document);
- foreach ($platform['xpaths'] as $query) {
- $nodes = $xpath->query($query);
- $amount = cleanNumber($nodes[0]->nodeValue);
- try {
- } catch (PDOException $e) {
- echo $e->getMessage();
- }
- break;
- }
- }
- }