Jump to content

Ricardo123

New Members
  • Posts

    4
  • Joined

  • Last visited

Ricardo123's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you guys the script is now runnig. I love how fast these guys and members response to questions about php Thank you so much. I try using before libxml function(true) then after loadhtml libxml (false) which didnt work so I try these and its a magic it works.
  2. Heres the updated code <?php ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(E_ALL); $html = file_get_contents("http://www.philippinepcsolotto.com/results/swertres-results"); $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DomXPath($dom); $nodes = $xpath->query('//span[@style="font-size:25px; color:#98293D"]'); foreach ($nodes as $node) { echo $node->nodeValue; } ?> Now after adding new code and revising it errors pops out here is it PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Namespace prefix xmlns of attribute fb is not defined in Entity, line: 3 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag header invalid in Entity, line: 182 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag nav invalid in Entity, line: 195 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : p in Entity, line: 222 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag article invalid in Entity, line: 224 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag header invalid in Entity, line: 225 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : a in Entity, line: 233 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag aside invalid in Entity, line: 316 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and center in Entity, line: 496 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag footer invalid in Entity, line: 503 in /home/a8880105/public_html/try.php on line 12 PHP Error Message Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : a in Entity, line: 716 in /home/a8880105/public_html/try.php on line 12 Help anyone.
  3. Code added but still not working got the same result. Please help me figure out how to solve this problem or can you you suggest me something that can get what I want to get from the site
  4. Example of it would be here: website: http://bit.ly/1C0IfkY Selected Source I only want to get <p data-iceapc="3" data-iceapw="6"><span data-iceapw="2" style="font-size:25px; color:#98293D;">11am: 2-0-7 </span> <span data-iceapw="2" style="font-size:25px; color:#98293D;">4pm: 7-2-3 </span> <span data-iceapw="2" style="font-size:25px; color:#98293D;">9pm: __ </span></p> Here's my code $dom = new DOMDocument(); $dom->loadHTML($Url); $xpath = new DomXPath($dom); $nodes = $xpath->query('//span[@style="font-size:25px; color:#98293D"]'); foreach ($nodes as $node) { echo $node->nodeValue; }
×
×
  • 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.