This is not your real issue.
Unfortunately, you aren't ever going to be able to find any elements with class b-programm_ended
. I looked at the source of https://tv.mail.ru/channel/1296/65/ and could not find any b-programm_ended
strings. However, I inspected the DOM with Chrome and did find some instances of b-programm_ended
. This means that class attributes are being created with jQuery, so your server-side PHP parsing will not find those tags.
However, when I inspect the XHR requests from the same site, there is some JSON data being pulled from
https://tv.mail.ru/ext/admtv/?sch.favorite_event=1&sch.recommended_main=1&cfg.get=1&sch.main=1&sch.channel=1296
that contains the data you may be looking for, for instance:
schedule: [{stop: "2015-04-26 05:15:00", name: "Белохвостые гиганты "Тэкомати"", genre_id: "142",…},…]
0: {stop: "2015-04-26 05:15:00", name: "Белохвостые гиганты "Тэкомати"", genre_id: "142",…}
episode_num: "6"
episode_title: "402-я серия"
genre_id: "142"
id: "36239842"
name: "Белохвостые гиганты "Тэкомати""
start: "2015-04-26 04:50:00"
stop: "2015-04-26 05:15:00"
year: "2013"
...
My suggestion for you is to use a JSON parser (json_decode in PHP) and conveniently pick out the information you are looking for from that data structure.