googlepagination.js example fails to retrieve additional pages when clicking on #pnnext

31 views
Skip to first unread message

Rob

unread,
Oct 20, 2016, 3:38:51 AM10/20/16
to CasperJS
✔ :(master) casperjs$ casperjs --version
1.1.3
✔ :(master) casperjs$ phantomjs --version
2.1.1

Kubuntu 16.04

Example returns at most 2 pages (even if there are more).

Both pages are returned are identical except the second page appears to have the google overlay applied when you click the Next link.

The to captures are attached.

Desperately looking for some enlightenment!

debug output follows
✔ :(master) casperjs$ casperjs --verbose --log-level=debug googlepagination.js nurses

[info] [phantom] Starting...
[info] [phantom] Running suite: 4 steps
[debug] [phantom] opening url: https://www.google.com.au/, HTTP GET
[debug] [phantom] Navigation requested: url=https://www.google.com.au/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://www.google.com.au/"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 2/4 https://www.google.com.au/ (HTTP 200)
[info] [phantom] Step anonymous 2/4: done in 1495ms.
[info] [phantom] Step _step 3/5 https://www.google.com.au/ (HTTP 200)
[info] [phantom] Step _step 3/5: done in 1515ms.
[info] [phantom] waitFor() finished in 40ms.
[info] [phantom] Step anonymous 4/5 https://www.google.com.au/ (HTTP 200)
[info] [remote] attempting to fetch form element from selector: 'form[action="/search"]'
[debug] [remote] Set "q" field value to nurses
[info] [remote] submitting form to /search, HTTP GET
[debug] [phantom] url changed to "https://www.google.com.au/#q=nurses"
[warning] [remote] unable to submit form
[info] [phantom] Step anonymous 4/5: done in 1586ms.
[info] [phantom] Step _step 5/5 https://www.google.com.au/#q=nurses (HTTP 200)
[info] [phantom] Step _step 5/5: done in 1601ms.
[info] [phantom] waitFor() finished in 698ms.
[info] [phantom] Step anonymous 6/6 https://www.google.com.au/#q=nurses (HTTP 200)
capturing page 1
[debug] [phantom] Capturing page to /home/christopher/work/grumples/casperjs/google-results-p1.png
[info] [phantom] Capture saved to /home/christopher/work/grumples/casperjs/google-results-p1.png
requesting next page: 2
[info] [phantom] Step anonymous 6/6: done in 2511ms.
[info] [phantom] Step _step 7/8 https://www.google.com.au/#q=nurses (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: #pnnext
[debug] [phantom] Mouse event 'mouseup' on selector: #pnnext
[debug] [phantom] Mouse event 'click' on selector: #pnnext
[debug] [phantom] url changed to "https://www.google.com.au/#q=nurses&start=10"
[info] [phantom] Step _step 7/8: done in 2543ms.
[info] [phantom] Step anonymous 8/8 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
[info] [phantom] Step anonymous 8/8: done in 2544ms.
[info] [phantom] Step _step 9/9 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
[info] [phantom] Step _step 9/9: done in 2564ms.
[info] [phantom] waitFor() finished in 40ms.
[info] [phantom] Step anonymous 10/10 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
capturing page 2
[debug] [phantom] Capturing page to /home/christopher/work/grumples/casperjs/google-results-p2.png
[info] [phantom] Capture saved to /home/christopher/work/grumples/casperjs/google-results-p2.png
requesting next page: 3
[info] [phantom] Step anonymous 10/10: done in 2829ms.
[info] [phantom] Step _step 11/12 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: #pnnext
[debug] [phantom] Mouse event 'mouseup' on selector: #pnnext
[debug] [phantom] Mouse event 'click' on selector: #pnnext
[info] [phantom] Step _step 11/12: done in 2834ms.
[info] [phantom] Step anonymous 12/12 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
[info] [phantom] Step anonymous 12/12: done in 2850ms.
[info] [phantom] Step _step 13/13 https://www.google.com.au/#q=nurses&start=10 (HTTP 200)
[info] [phantom] Step _step 13/13: done in 2870ms.
[warning] [phantom] Casper.waitFor() timeout
that's all, folks.
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "about:blank"




google.js
google-results-p1.png
google-results-p2.png

Ken

unread,
May 25, 2017, 7:05:53 PM5/25/17
to CasperJS
Hi Rob, I'm a CasperJS user for couple of years. Looking through old issues in the mailing list and the GitHub repo issues. Not sure if you have already found a solution for this?
Reply all
Reply to author
Forward
0 new messages