Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Can't parse CSS class
07-30-2013, 06:20 AM #1
- Join Date
- Sep 2007
- 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.
$html = file_get_html('http://www.nfl.com/schedules/2013/REG/Jets');
<span class="at hide">at</span>
<span class="team-logo away bills"><span></span></span>
<span class="team-name away ">Bills</span>
<span class="at ">at</span>
<span class="team-logo home patriots"><span></span></span>
<span class="team-name home ">Patriots</span>
foreach($html->find('.at hide') as $e)
echo $e->plaintext . 'home game<br>';
07-30-2013, 06:37 AM #2
- Join Date
- Nov 2010
- Thanked 248 Times in 248 Posts