G
G
gonchar0ff2016-02-22 17:13:06
PHP
gonchar0ff, 2016-02-22 17:13:06

How to display text when parsing with PHP Simple HTML DOM Parser?

Good evening everyone!
Perhaps the question is not quite correct. Not so long ago I started studying PHP, and I want to try to write a dynamic site parser, to make it more interesting - I took the Olimp bookmaker as an example. I want to get, for example, the coefficient for the victory of the first team, using PHP Simple HTML DOM Parser. Now it turns out to get in general all possible options for bets and odds. But how do I display only the one I need? The code is currently like this:

//Подключение библиотеки для парсинга
require_once('simple_html_dom.php');
//Получаем HTML код нужной нам страницы
$html = file_get_html('http://olimp.kz/index.php?page=line&action=2&live[]=22903918');
//В цикле выбираем все элементы с тегом <nobr> и выводим их построчно
foreach($html->find('nobr') as $element) 
echo $element . '<br>';

In the output I get the following:
Interface language:
Odds format:
F1(-3) - 1.95
F2(3) - 1.8
Tot(5.5) M - 2.1 B - 1.7
Danubio (res) (4.5) men - 1.65 Danubio (res) (4.5) bol - 2.15
El Tanke Sisley (res) (1.5) men - 1.45 El Tanke Sisley (res) (1.5) ball - 2.6
El Tanke Sisley (res): 1 goal - 1.45
El Tanke Sisley (res): 2 goals - 3.1
El Tanke Sisley (res ) ): 3 or more goals - 12
3:2 - 9
3:1 - 5.5
4:1 - 2.9

Etc. But I don't need all these events. For example, I want to see the statistics of 10 matches that go to Live, and display the values ​​of only one bet, for example W1 (Win the first team), for all 10 matches. Tell me where to dig, what to look ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
entermix, 2016-02-22
@entermix

htmlbook.ru/marki/selectory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question