Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy my PHP QueryPath 2.1.2 WAMP scraping script only returns 5 articles instead of 43? Timeout?
    primarykey
    data
    text
    <p>I am trying to scrape 43 blogs posts from my blog and store them in array but when I print_r the array it only returns first 5 [with the rest empty] instead of all 43. Why? And How I can get all 43? I run this script from cmd.exe [command line] on WAMP.</p> <pre><code> &lt;?php require 'src/QueryPath/QueryPath.php'; $qp1 = htmlqp('http://myblog.com/blog'); $qp2 = htmlqp('http://myblog.com/blog/Page-2.html'); $qp3 = htmlqp('http://myblog.com/blog/Page-3.html'); $qp4 = htmlqp('http://myblog.com/blog/Page-4.html'); foreach ($qp1-&gt;find('ol&gt;li a[href],.jbReadon') as $item) { $links[] = $item-&gt;attr('href'); } foreach ($qp2-&gt;find('ol&gt;li a[href],.jbReadon') as $item) { $links[] = $item-&gt;attr('href'); } foreach ($qp3-&gt;find('ol&gt;li a[href],.jbReadon') as $item) { $links[] = $item-&gt;attr('href'); } foreach ($qp4-&gt;find('ol&gt;li a[href],.jbReadon') as $item) { $links[] = $item-&gt;attr('href'); } print_r($links); foreach ($links as $link) { $url = "http://myblog.com".$link; $content[] = htmlqp($url)-&gt;find('.jbIntroText p')-&gt;text(); } print_r($content); ?&gt; </code></pre> <p>after key 5 of the array onwards, all the values are empty. [I couldnt upload the image either from laptop or web so heres the link to screenshot of cmd.exe] <a href="http://img546.imageshack.us/img546/6092/cmdafter5arrayisempty.jpg" rel="nofollow">http://img546.imageshack.us/img546/6092/cmdafter5arrayisempty.jpg</a></p> <p>I am obviously a beginner so any suggestions how to make this code more succint or how to better accomplish my scraping prototype would be appreciated. All constructive criticism welcome as well :-P</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload