Perjal Posted August 15, 2014 Share Posted August 15, 2014 This is my school project "tv-info" that uses simple_html_dom. My tv.php // scrape a tag $html = file_get_html("http://[redacted]/tv-opas?g=peruskanavat-1"); foreach($html->find($tag) as $e) $main = $e->plaintext . '<br />'; //plain $html = file_get_html("http://[redacted]/tv-opas?g=peruskanavat-1"); echo $html->find('[table class="fullwidth"]', 1)->innertext.'</table>'; So my problem is how I can remove some tags in this page? It shows too much things and what I want it is show only tv-table.. There is inside this this tv table like this: <table class="content-layout"> <tr> <td id="content" class="content"><div class="submenu-top-container"> <form action="haku" class="right" style="margin-top: 5px;"> <div class="input-wrapper"> <input type="text" name="q" placeholder="Kirjoita hakusana..." style="width: 165px;"><input type="hidden" name="t" value="tv"><button>Hae</button> </div> </form> <div class="submenu-top-item selected"> <a href="/tv-opas" class="submenu-top-item-link">Ohjelmaopas</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=suosikkikanavat" class="submenu-top-item-link">Suosikkikanavat</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=movies" class="submenu-top-item-link">Elokuvat</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=sports" class="submenu-top-item-link">Urheilu</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=favorites" class="submenu-top-item-link">Suosikit</a> </div> </div> Thank you if someone can help me! And if someone ask me to use tvrage, I don't because I'm from Finland and there is no support for Finnish tv-series etc.. Link to comment https://forums.phpfreaks.com/topic/290475-tv-information/ Share on other sites More sharing options...
CroNiX Posted August 15, 2014 Share Posted August 15, 2014 target the tbody of the table.fullwidth Link to comment https://forums.phpfreaks.com/topic/290475-tv-information/#findComment-1487908 Share on other sites More sharing options...
Perjal Posted August 15, 2014 Author Share Posted August 15, 2014 Back in this project.. So I figured out that and changed this line echo $html->find('[table class="fullwidth"]', 1)->innertext.'</table>'; to this: echo $html->find('[table class="ohjelmakartta"]', 2)->innertext.'</table>'; Now I have little problem Link to comment https://forums.phpfreaks.com/topic/290475-tv-information/#findComment-1487909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.