marionette

记录一次爬虫报错:Message: Failed to decode response from marionette

不打扰是莪最后的温柔 提交于 2020-08-17 05:31:58
由于标题中的错误引发: Message: Tried to run command without establishing a connection 解释: 先说一下我的爬虫架构,用的是firefox+selenium,上面的那个错误是因为浏览器退出之后,爬虫还要浏览器去执行一些命令,所以才报上面的错误,那第二个问题来了: 浏览器为什么会自动crash(崩溃)呢,一般来说都是因为资源不够用了,什么资源呢?内存资源,浏览器是很占用的内存,而且有的爬虫为了加快爬虫速度会让浏览器做缓存, 这样导致浏览器占用的内存更多 解决办法: 1.根据爬虫占用的资源情况,合适的增加内存 2.降低爬虫的速度,让浏览器有点空闲,特别是在启动多个浏览器的爬虫中 ---------------------------------2019-04-24更新-------------------------------- 上面的说法并没有错,但是还是有些情况没有考虑进去,其实浏览器会崩溃的主要原因是因为浏览器内存泄露,也就是说,由于浏览器默认是开启缓存功能的, 这样随着爬虫的运行,浏览器的缓存就会越来越大,最终一定会导致浏览器内存泄露( 前提是浏览器不重启的爬虫,如果浏览器隔一段时间就重启,不会有这个问题 ), 至于说怎么在爬虫中禁用浏览器缓存,这个在我另一篇博客中有提到,就不说了 来源: oschina 链接:

New to marionette, router and controller config

…衆ロ難τιáo~ 提交于 2020-01-31 18:48:41
问题 I have been looking at the various marionette questions and not found what i'm after and was hoping someone could give me some sound advice and a couple pointers. I am new to this and just looking to build on the boilerplate starter pack i selected on github https://github.com/coombsj/RequireJS-BackboneJs-MarionetteJS-Bootstrap_Starter I would like to establish two things; how to create routes & contoller config for the afor referenced project - please see examples explained below.?? using

New to marionette, router and controller config

早过忘川 提交于 2020-01-31 18:48:06
问题 I have been looking at the various marionette questions and not found what i'm after and was hoping someone could give me some sound advice and a couple pointers. I am new to this and just looking to build on the boilerplate starter pack i selected on github https://github.com/coombsj/RequireJS-BackboneJs-MarionetteJS-Bootstrap_Starter I would like to establish two things; how to create routes & contoller config for the afor referenced project - please see examples explained below.?? using

Is there a rule of thumb to decide when to use trigger or triggerMethod in Backbone.Marionette?

左心房为你撑大大i 提交于 2020-01-23 05:28:21
问题 I'm playing a bit with Backbone.js and Backbone.Marionette and I would like to know what's the difference between trigger and triggerMethod . In particular, is there any rule of thumb to decide when use the former or the latter? In my mind events, for example, are useful to communicate between a DOM element and its view. triggerMethod is used in Marionette to update in cascade different components, e.g. a layout calls the show method to its children (children respond to onShow ). So, for me

Marionette, backbone js betting game

↘锁芯ラ 提交于 2020-01-14 03:07:29
问题 This is a betting game, made in backbone. I have a bounty of 100 to help me refactor it into a marionette based application. I am unsure where to start - in terms of reconfiguring the models, how to swap the views out to make them regions. I believe the steps would be to start with creating a new marionette application and router. var app = Marionette.Application.extend({ initialize: function(options) { console.log('My container:', options.container); } }); var app = new app({container: '#app

Marionette.js CollectionView, only render specific models

China☆狼群 提交于 2020-01-12 07:53:06
问题 I am refactoring my Backbone.js application to use Marionette.js, and I am trying to wrap my head around a CollectionView . Suppose I have several ItemView s with the model Cow : // Declare my models. var Cow = Backbone.Model.extend({}); var Cows = Backbone.Collection.extend({ model: Cow }); // Make my views var GrassPatch = Marionette.ItemView.extend({ tagName: 'div', template: "<section class='grass'>{{name}}</section>", }) var Pasture = Marionette.CollectionView.extend({}); // Instantiate

Capture scroll event on div

让人想犯罪 __ 提交于 2020-01-11 09:24:27
问题 I'm trying to capture the scroll event within a Backbone.Marionette.CompositeView, but without success. As an exercise, I'm rewriting http://www.atinux.fr/backbone-books/ using Backbone.Marionette. As you can see, when you scroll down, more books are fetched and displayed (i.e. infinite scroll). However, I'm unable to capture the scroll event on my view. Here's my (simplified) code: LibraryView = Backbone.Marionette.CompositeView.extend({ // properties, initializer, etc. events: { 'scroll':

How to add Google Tag Manager firing rule for Backbone Marionette site?

一世执手 提交于 2020-01-07 07:26:18
问题 I have already built a site with backbone marionette and now I am trying to use Google Tag manager to add the tracking. But I have no idea how to configure GTM, in order to listen page change and button click event. 回答1: Clicks are up to you to set up listening events and track manually from views. Page views can be tracked like this: Backbone.history.on('route', function() { // Send Backbone.history.fragment to your page view tracker }); 回答2: There is a bit of fiddling required there. Tag

Construct views for data nested several levels deep

╄→尐↘猪︶ㄣ 提交于 2020-01-06 20:36:40
问题 I'm trying to build an order system for a friend using django/tastypie on the server side and backbone/marionette on the client side. The server side poses no bigger problem but since I'm an inexperienced frontend developer I'm kinda stuck; The simpler case went just fine, e.g. to list, add, edit and remove an Article (just a table in my database with sku, description and so on) using Composite- and ItemViews.The problem is when I'm trying to construct the views for an Order since it consists

googleMaps appears in grey after refresh page

被刻印的时光 ゝ 提交于 2020-01-06 20:02:04
问题 i am a beginner in backbone and node js, i have added google maps to my template using these commands: script(src='/lib/google-maps/lib/Google.js') script(src='http://maps.googleapis.com/maps/api/js') script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js') div.googleMap( style='width: 250px; height: 250px;') and in my views : mod.mapTemplate = Marionette.ItemView.extend({ template: '#actors-map-template', initialize: function () { var mapProp = this.model.get('mapProp')