nightmare

Error in loading nightmare while using webpack

雨燕双飞 提交于 2021-02-11 04:23:26
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

Error in loading nightmare while using webpack

霸气de小男生 提交于 2021-02-11 04:22:21
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

Error in loading nightmare while using webpack

纵饮孤独 提交于 2021-02-11 04:20:36
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

Selecting and Clicking Elements based on class name with Nightmare.js

妖精的绣舞 提交于 2021-02-08 10:16:33
问题 im trying to select an element that's an image withing a div and then click it using nightmare.js. Below is the element im trying to click and below that the code im using. <div class="custom-navigator-right"><img onload="this.__gwtLastUnhandledEvent="load";" src="http://iris.generali.gr/iris/webiris/clear.cache.gif" style="width:40px;height:43px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAArCAYAAAAKasrDAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD

Nightmare中文文档(机器翻译)

你离开我真会死。 提交于 2020-01-29 23:47:45
Nightmare Nightmare is a high-level browser automation library from Segment . The goal is to expose a few simple methods that mimic user actions (like goto , type and click ), with an API that feels synchronous for each block of scripting, rather than deeply nested callbacks. It was originally designed for automating tasks across sites that don't have APIs, but is most often used for UI testing and crawling. Under the covers it uses Electron , which is similar to PhantomJS but roughly twice as fast and more modern. ⚠️ Security Warning: We've implemented many of the security recommendations

基于nightmare的美团美食商家爬虫实践

泄露秘密 提交于 2020-01-22 16:39:53
前言 美团商家页分析 需要爬取的数据有(这里没有按人数爬) 爬虫工具选取 pysipder scrapy nightmare 同步任务 js动态加载 中断继续 爬坑总结 示例代码 前言 上学的时候自己写过一些爬虫代码,比较简陋,基于HttpRequest请求获取地址返回的信息,再根据正则表达式抓取想要的内容。那时候爬的网站大多都是静态的,直接获取直接爬即可,而且也没有什么限制。但是现在网站的安全越来越完善,各种机器识别,打码,爬虫也要越来越只能才行了。 前段时间有需求要简单爬取美团商家的数据,做了一些分析,实践,在这里总结分享。 美团商家页分析 1、城市大全可以很容易的在这个页面爬出来 http://www.meituan.com/index/changecity/initiative 2、每个城市一个地址,例如深圳: http://sz.meituan.com/category/meishi 3、可以按照分类、区域、人数来分类 4、商家列表是动态JS加载的,并且会有很多页数 5、根据商家列表再进入商家详情获取数据 这样爬取流程即为 1、进去城市美食页 2、抓取分类,循环选择分类 3、抓取区域,循环选择区域 4、抓取人数,循环选择人数 5、判断是否有下一页按钮,循环进入下一页 6、进入详情页抓取,提交之后continue 需要爬取的数据有(这里没有按人数爬) CREATE

How do I click this link using nightmare?

三世轮回 提交于 2020-01-22 03:44:08
问题 Here is everything involving the link: <a class="" data-images="{"detail_url":"//assets.supremenewyork.com/148393/ma/hBwFmRXhVKI.jpg","zoomed_url":"//assets.supremenewyork.com/148393/zo/hBwFmRXhVKI.jpg"}" data-style-name="Black" data-style-id="19033" data-sold-out="false" data-description="null" href="/shop/bags/lkav6jh17/xfdbgpiea" data-no-tubolink="data-no-tubolink"><img width="32" height="32" src="//d17ol771963kd3.cloudfront.net/148393/sw/hBwFmRXhVKI.jpg" alt="Hbwfmrxhvki"></a> I use

NightmareJS multiple reports from same test

三世轮回 提交于 2020-01-14 06:37:10
问题 Thanks to @pipo_dev I was able to solve an issue I was having with multiple evaluations in NightmareJS, one thing that I would like to know is if I can provide multiple reports for the same test, take the following as an example: describe('test google search results', function() { this.timeout(15000); it('should find the nightmare github link first', function(done) { var nightmare = Nightmare({show: true}) nightmare .goto('http://google.com') .wait(1000) .type('form[action*="/search"] [name=q

Nightmare JS not working

时间秒杀一切 提交于 2020-01-11 09:03:52
问题 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')

How to make nightmare forcefully timeout

跟風遠走 提交于 2020-01-06 08:21:09
问题 As the title implies I am trying to make my script timeout forcefully, specifically if a condition (that returns done() ) isn't met. Here is some code: import * as Nightmare from "nightmare"; describe("Login Page", function() { this.timeout("30s"); let nightmare = null; beforeEach(() => { nightmare = new Nightmare({ show: true }); }); let pageUrl; describe("give correct details", () => { it("should log-in, check for current page url", done => { nightmare .goto(www.example.com/log-in) .wait