Jump to content

TV-information


Perjal
Go to solution Solved by Perjal,

Recommended Posts

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 by requinix
domain name redacted by request
Link to comment
Share on other sites

  • Solution

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 :D

QO3HBWQ.png

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.