Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    60
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Can't parse CSS class

    I'm trying to parse the NFL's season game schedule for the NY Jets.

    I'm using PHP and a library to parse the DOM. I'm having trouble figuring out how to determine a home game vs an away game. I can see in the tags how it's determine but I can't seem to parse it in PHP to get the correct results. I see the class 'at ' and 'at hide' so that's how it's determined. But the find command doesn't seem to work to parse it.

    Thanks for any help.

    PHP Code:
    include('simple_html_dom.php');
    $html file_get_html('http://www.nfl.com/schedules/2013/REG/Jets');

    <
    div class="list-matchup-row-team"
    <
    span class="at hide">at</span
    <
    span class="team-logo away bills"><span></span></span
    <
    span class="team-name away ">Bills</span
    </
    div>

    <
    div class="list-matchup-row-team"
    <
    span class="at ">at</span
    <
    span class="team-logo home patriots"><span></span></span
    <
    span class="team-name home ">Patriots</span
    </
    div


    foreach(
    $html->find('.at hide') as $e)
    {
        echo 
    $e->plaintext 'home game<br>';


  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    you should post this in the php forum, not a css issue.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •