Perjal Posted August 15, 2014 Share Posted August 15, 2014 (edited) 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.. Edited March 31, 2018 by requinix domain name redacted by request Quote Link to comment Share on other sites More sharing options...
CroNiX Posted August 15, 2014 Share Posted August 15, 2014 target the tbody of the table.fullwidth Quote Link to comment Share on other sites More sharing options...
Solution Perjal Posted August 15, 2014 Author Solution 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.