Goyax.php 903 Bytes
Newer Older
1
2
3
4
<?php

namespace app\Models\parserSkripte;
use App\Models\Searchengine;
5
use Symfony\Component\DomCrawler\Crawler;
6
7
8
9
10

class Goyax extends Searchengine 
{
	public $results = [];

11
	function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager)
12
13
14
15
	{
		parent::__construct($engine, $metager);
	}

16
	public function loadResults ($result)
17
18
	{
		
19
20
		$crawler = new Crawler($result);
		$crawler->filter('tr.treffer')->each(function (Crawler $node, $i)
21
		{
22
23
			$title = $node->filter('td.name')->text();
			$link = "http://www.goyax.de" . $node->filter('td.name > a')->attr('href');
24
			$anzeigeLink = $link;
25
			$descr = "Aktie: " . $node->filter('td.waehrung')->text() . " " . $node->filter('td.isin')->text();
26
27
28
29
30
31
32
33
34
35

			$this->counter++;
			$this->results[] = new \App\Models\Result(
				$this->engine,
				$title,
				$link,
				$anzeigeLink,
				$descr,
				$this->gefVon,
				$this->counter
36
37
38
			);
		} );

39
40
41

		
	}
42
}