nightmare

Use Nightmare.js without ES6 syntax and yield

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I built a simple node script using nightmare.js to scrape websites var Nightmare = require('nightmare'); var vo = require('vo'); vo(run)(function(err, result) { if (err) throw err; }); function *run() { var x = Date.now(); var nightmare = Nightmare(); var html = yield nightmare .goto('http://google.com') .evaluate(function() { return document.getElementsByTagName('html')[0].innerHTML; }); console.log("done in " + (Date.now()-x) + "ms"); console.log("result", html); yield nightmare.end(); } I want to run this in an environment using an older

ie10 and flexboxes? (nightmare)

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Unfortunately, I have to make my website code compatible with Internet Explorer 10 and am having some issues, even after reading the documentation on their official website here is my css code: . uberflex { display : flex ; flex - direction : column ; flex - wrap : wrap ; justify - content : flex - start ; align - items : flex - start ; display : - webkit - flex ; - webkit - flex - flow : column wrap ; - webkit - justify - content : flex - start ; - webkit - align - items : flex - start ; display : - ms - flexbox ; - ms - flex -

Nightmare / Electron : Navigation Error (code - 118)

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Scraping with nightmare has been a breeze until recently , i started encountering errors with no details and the title "navigation error" and the error code 118 as shown below. { [Error: navigation error] '0': { message: 'navigation error', code: -118, details: '', url: ' http://markets.ft.com/research/Browse-Companies ' }, length: 1, errors: [ { message: 'navigation error', code: -118, details: '', url: ' http://markets.ft.com/research/Browse-Companies ' } ] } My nightmare code (Node.Js) : function *run(){ var nightmare = Nightmare({show :

nightmare API

匿名 (未验证) 提交于 2019-12-02 23:49:02
nightmare API 简单介绍 2016-04-18 nightmare 文档 可以参考学习。 API 描述 Nightmare(options) 初始化实例,options 为设置 Electron 浏览窗口的配置, 参考文档 waitTimeout (default: 30s) wait 等待最长时间,超过这个时间还未返回,则抛出异常 paths 为 Electron 设置数据路径, 参考文档 switches chrome 的一些配置, 参考文档 以上的 API 均为 nightmare 初始化实例对象的配置,例如我们要配置浏览窗口的大小,如下所示: var nightmare = new Nightmare({ width: 1000, height: 800 show: true }); API 描述 .goto(url) 加载 url 页面 .back() 后退到前一页 .forward() 前进到下一页 .refresh() 刷新当前页 .click(selector) 点击selector元素 .mousedown(selector) 鼠标按下selector元素 .type(selector [, text]) 如果有text参数,则向 selector 输入 text,否则清空 selector , 并触发键盘事件 .insert(selector [,

what are those triple dot inside the array? marked it with a comment [duplicate]

落爺英雄遲暮 提交于 2019-12-02 13:28:13
This question already has an answer here: Spread Syntax ES6 4 answers I was learning how to web scrap in nodejs and came across this kind of array. What is the meaning? articles = [ //WHAT IS THIS ...articles, ...new_articles ]; Joel When we see three dots (…) in the code, it's either rest parameters or the spread operator. Rest parameters : When three dots (…) is at the end of function parameters it will gather the rest of the list of arguments into an array. spread operator : Expands elements of an array (or all iterables) into places where multiple elements can fit. yourFunction(arg1, arg2,

Nightmare JS not working

て烟熏妆下的殇ゞ 提交于 2019-12-01 18:01:44
I know the title of the question looks very vague! But that's there's to it. I installed nodejs on my production server, which had phantomjs working properly, then I installed nightmare via npm install nightmare , I can see it in node_modules, I tried the example listed by the developers on github: var Nightmare = require('nightmare'); var nightmare = Nightmare({ show: true }) nightmare .goto('http://yahoo.com') .type('input[title="Search"]', 'github nightmare') .click('#uh-search-button') .wait('#main') .evaluate(function () { return document.querySelector('#main .searchCenterMiddle li a')

Moving between pages and scraping as I go with Nightmare

早过忘川 提交于 2019-12-01 14:00:01
There is a website that contains a page with a list of 25 entries, where each entry is a link to a page containing some information that I need. I want get to the listing page and then: 1) click on link to first entry 2) retrieve all the html 3) click back to the listing page (there is a button for this) 4) repeat for every other listing I would also like to do this as efficiently as possible which I've been told means leveraging promises. Here's my code sketch, which doesn't work: var Nightmare = require('nightmare'); var nightmare = Nightmare({ openDevTools: true, show: true }) var Xray =

Moving between pages and scraping as I go with Nightmare

十年热恋 提交于 2019-12-01 12:13:18
问题 There is a website that contains a page with a list of 25 entries, where each entry is a link to a page containing some information that I need. I want get to the listing page and then: 1) click on link to first entry 2) retrieve all the html 3) click back to the listing page (there is a button for this) 4) repeat for every other listing I would also like to do this as efficiently as possible which I've been told means leveraging promises. Here's my code sketch, which doesn't work: var

Download a file using Nightmare

冷暖自知 提交于 2019-11-28 23:55:06
I am using Nightmare to create a automated downloader for today's newspaper. I managed to login and go the the specified page. However I could not find out how to download a file with Nightmare. var Nightmare = require('nightmare'); new Nightmare() .goto('https://login.nrc.nl/login?service=http://digitaleeditie.nrc.nl/welkom') .type('input[name="username"]', 'Username') .type('input[name="password"]','Password') .click('button[type="submit"]') .wait() .goto('http://digitaleeditie.nrc.nl/digitaleeditie/NH/2014/10/20141124___/downloads.html') .wait() .click('a[href="/digitaleeditie/helekrant

Nightmare.js error: Search failed: Nothing responds to “goto”

空扰寡人 提交于 2019-11-28 14:30:39
I am running into an error, when including vanilla JS in nightmare.js. I want to make sure that every email in my array is inputted into the system. A for loop would be ideal, but I have continually run into error such as: Search failed: Nothing responds to "goto" Here is my code: var jquery = require('jquery'); var Nightmare = require('nightmare'); var nightmare = Nightmare({ show: true, dock: true }); var siteName = "*********"; var username = "*********"; var password = "*********"; var outboundEmailArray = [ { "from_name": "TestOutbound", "email_username": "array1", "email_domain":