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 to the CF scene
    Join Date
    Apr 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php scrape script showing only blank page

    Hi I have a Php screen scrape script that only shows a blank page, it was working before but when we installed noahs classifieds then the problem occured. here is the code

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html>
        <head>
         <title>Weather API</title>
    </head>
        <body>
        <div id="widget-wrapper"><!-- start widget-wrapper-->
         <div class="weather"><!-- start weather-->    
    <h2><a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top">Current Weather</a></h2>
    <?php

    include('simple_html_dom.php');
    include (
    'phpQuery.php');   


    // Create DOM from URL

    $html file_get_html('http://www.weather.bm/');
    ?>
    <a href="http://www.royalgazette.com/section/weather" target="_top">
     <?php 

        
    // find all span tags with class=gb1
    $element $html->find("div"); 


    $element[66]->class "mwraping66";
    foreach(
    $html->find('.mwraping66 img') as $e)

    $doc phpQuery::newDocumentHTML$e );  $containers pq('.mwraping66'$doc); foreach( $containers as $container ) {     $div pq('img'$container);      
    $div->eq(1)->removeAttr('style')->addClass('thumbnail')->htmlpq'img'$div->eq(1))->removeAttr('height')->removeAttr('width')->removeAttr('alt') ); 
    $div->eq(0)->removeAttr('style')->addClass('day')->htmlpq'u'$div->eq(0) )->html() );           $div->eq(2)->removeAttr('style')->addClass('description');   }  print $doc
    ?>
     </a>
      <span class="condition">
                  <a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top"><H4>
     <?php
    $element 
    $html->find("div"); 


    $element[31]->class "mwraping31";


    foreach(
    $html->find('.mwraping31') as $e)

        echo 
    $e->plaintext
     
    ?></H4><p>
     
     
     
    <?php
    $element 
    $html->find("div"); 

    $element[28]->class "mwraping28"



    foreach(
    $html->find('.mwraping28') as $e)

        echo 
    $e->plaintext;
        
        
     
    ?></p></a></span>
                     </div><!-- end weather-->
     
        </div>    <!-- end widget-wrapper-->
        </body>
    </html>
    The weird part is it's working on my other hosting provider
    here is my site
    http://www.rgbdahosting.com/weather/testwiget.php

    here is my other hosting which is working
    http://www.j2sdesign.com/weather/testwiget.php

    I am thinking that installing noahsclassifieds might have change some settings in the php but that shouldn't happen. can anyone give me an advice

    it even doesn't work on some other script example
    http://komunitasweb.com/2009/09/show...e-weather-api/ I just cut and paste it and still I only get blank page. But the authors demo page is working

    thanks in advance appreciate your help if you need phpinfo I can give it you

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Check your error logs for errors pertaining to this script.
    There is almost no standard PHP functionality in what you have provided. Every function and method call is custom, so it could be any or all of these that are causing issues.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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