用Nightmarejs 获取百度搜索结果数量
2017-11-14 10:06
411 查看
const Nightmare = require('nightmare'); const nightmare = Nightmare({ typeInterval: 500, //openDevTools: {mode: 'detach'}, show: true }); nightmare .goto('https://www.baidu.com') .type('input#kw', 'github') .click('input#su') .wait('div.nums') .evaluate(() => document.querySelector('div.nums').innerHTML) .end() .then((text) => { // This will log the your local IP console.log('search: %s result.', text.match(/[\d,]+/)[0]); }) .catch((error) => { console.error('Search failed:', error); }); //console.log(nightmare.engineVersions());
目前的输出:search: 68,200,000 result.
相关文章推荐
- PHP 批量获取 百度搜索结果 网址列表
- 解析百度搜索结果链接的url,获取真正的url
- python爬虫(11)身边的搜索专家——获取百度搜索结果
- cefSharp获取百度搜索结果页面的源码
- 使用BeautifulSoup爬虫程序获取百度搜索结果的标题和url示例
- 获取百度搜索结果的真实url以及摘要和时间
- 使用BeautifulSoup爬虫程序获取百度搜索结果的标题和url示例
- selenium-webdriver循环点击百度搜索结果以及获取新页面的handler
- 根据查询的关键字,实现获取百度指定页数的搜索结果的信息(网页地址,标题,摘要,并有排序的说明)
- 百度搜索结果中link?url 格式的真实地址获取方式
- C++和python如何获取百度搜索结果页面下信息对应的真实链接(百度搜索爬虫,可指定页数)
- 解析百度搜索结果链接的url,获取真正的url
- python如何获取百度搜索结果的真实URL
- JQuery+JS实现仿百度搜索结果中关键字变色效果
- 用百度搜索sb,第一个结果是??
- 百度公布图文搜索结果优化方法预示着图文时代已经到来
- php获取从百度搜索进入网站的关键词
- 百度的搜索结果 部分未做链接,这是为什么?
- 解析百度搜索结果页面的python脚本(Linux/Win都可以运行)
- 抓取百度搜索结果——解密百度狗