page.open('http://example.com/?q=houston', function () {

  // Checks for bottom div and scrolls down from time to time
window.setInterval(function() {
// Checks if there is a div with class=".has-more-items"
// (not sure if this is the best way of doing it)
var count = page.content.match(/class=".has-more-items"/g); if(count === null) { // Didn't find
page.evaluate(function() {
// Scrolls to the bottom of page
window.document.body.scrollTop = document.body.scrollHeight;
});
}
else { // Found
// Do what you want
...
phantom.exit();
}
}, 500); // Number of milliseconds to wait between scrolls });

最新文章

  1. vc++ 判断文件或是文件夹是否存在,比较好的做法
  2. SQL Server创建复合索引时,复合索引列顺序对查询的性能影响
  3. 在configure distribution时遇到错误,不能打开sql agent
  4. [转载]& 引用 取地址
  5. 2014-2015 Codeforces Trainings Season 2 Episode 7 G Gophers --线段树
  6. SmartGit STUDY
  7. 信号之alarm和pause函数
  8. Java常见面试题总结
  9. hadoop,yarn和vcpu资源配置
  10. XListview的下拉刷新、上拉加载、用Pull解析XML
  11. Bootstrap——一款超好用的前端框架
  12. C语言第一次博客作业 陈张鑫
  13. HDOJ 1217 Arbitrage (最短路)
  14. MongoDB 常用的几大GUI工具
  15. JMeter 逻辑控制之While循环控制器(While Controller)
  16. 斗鱼宣布获C轮15亿融资 直播行业进入资本时代
  17. weblogic在64位windows的设置
  18. [转] 机器学习是什么——周志华
  19. Golang之实现(链表)
  20. Android编程 高德地图 中如何重写 定位按键 的触发事件 (com.amap.api.maps2d.LocationSource)点击定位后不仅定位在地图中心点上而且可以设置地图的缩放大小和提示

热门文章

  1. 学习2__STM32--汉字显示
  2. CodeForces - 669D
  3. centos6.5安装jdk(解压tar.gz)
  4. javascript面向对象精要第三章对象整理精要
  5. C#.Net 持久化对象为XML文件
  6. H5新特性总结
  7. Python基础【day03】:字典(一)
  8. Codeforces 526D Om Nom and Necklace (KMP)
  9. SLT 优先队列 哈弗曼树最小带权路径
  10. Simple Sort