python爬取知乎live_爬取个人知乎收藏夹内容生成网站

知乎个人收藏

栏目总览

{{ description }}

That's all!

{{ modalMessage }}

© 2017 treelake.

Vue.component('my-carousel', {

template: '

![](https://n2-s.mafengwo.net/fl_progressive,q_mini/s10/M00/74/B6/wKgBZ1irpQ-Afw_uAAepw3nE8w884.jpeg)![](https://c4-q.mafengwo.net/s10/M00/21/50/wKgBZ1imrvqAafuJAAeRHcfhBBg66.jpeg?imageMogr2%2Finterlace%2F1)
'

})

Vue.component('my-ul', {

template: '

',

props: ['items'],

methods: {

changeLimit() {

if (this.limitFrom > this.items.length - this.limitNum) {

this.limitFrom = 0;

} else {

this.limitFrom += this.limitNum;

}

if (this.limitFrom == this.items.length) {

this.limitFrom = 0

}

console.log(this.limitFrom)

},

simpleContent(msg) {

this.$dispatch('child-msg', msg)

// 使用 $dispatch() 派发事件,事件沿着父链冒泡

},

},

data() {

return {

limitNum: 5,

limitFrom: 0,

}

},

events: {

'parent-msg': function () {

this.changeLimit()

}

},

})

Vue.component('my-card', {

template: '

{{ collection.ctitle }}

换一换 ',

props: ['collection'],

methods: {

notify: function () {

this.$broadcast('parent-msg')

// 使用 $broadcast() 广播事件,事件向下传导给所有的后代

}

}

})

var shuju, answer;

new Vue({

el: '#app',

data: {

description: '',

visible: false,

// ctitle: '',

allqa: [],

collection: {

'clist': [],

'ctitle': '',

},

left: [],

right: [],

modalMessage: '旧时光回忆完毕!',

modalTitle: 'Welcome!',

rawHtml: ' treelake '

},

methods: {

show() {

this.visible = true;

},

showLeave() {

this.rawHtml = '';

this.modalMessage = '旧时光回忆完毕!';

this.show();

}

},

events: {

'child-msg': function (msg) {

this.$http.jsonp('/find' + msg.answer_url, {}, { // 单文件测试:http://localhost:5000/find

headers: {},

emulateJSON: true

}).then(function (response) {

// 这里是处理正确的回调

answer = response.data;

this.rawHtml = answer.answer;

}, function (response) {

// 这里是处理错误的回调

console.log(response);

});

this.modalMessage = '';

this.modalTitle = msg.title;

this.show();

}

},

ready: function () {

this.$http.jsonp('/collections', {}, { // 单文件测试 http://localhost:5000/collections/

headers: {},

emulateJSON: true

}).then(function (response) {

// 这里是处理正确的回调

shuju = response.data

for (i in shuju) {

this.description += (shuju[i].ctitle + ' ');

// console.log(shuju[i])

}

// this.ctitle = shuju[0].ctitle

// this.collection = shuju[0]

this.allqa = shuju

half = parseInt(shuju.length / 2) + 1

this.left = shuju.slice(0, half)

this.right = shuju.slice(half, shuju.length)

console.log(this.collection)

}, function (response) {

// 这里是处理错误的回调

console.log(response);

});

}

})

#list {

padding: 10px

}

#list li {

margin-bottom: 10px;

padding-bottom: 10px;

}

.jumbotron img {

width: 100%;

}

.author-badge {

width: 38px;

height: 38px;

border-radius: 6px;

display: inline-block;

}

#inner-content img {

width: 100%;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值