在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答

你沒做自適應(yīng)? 你網(wǎng)頁(yè)調(diào)試F12 點(diǎn)開手機(jī)調(diào)試模式 看看,我猜樣式應(yīng)該不對(duì)

艷骨 回答

var video=document.getElementById("v");
video.addEventListener('play',function(){

$('.廣告').hide();     

});
video.addEventListener('pause',function(){

$('.廣告').show();  

})

陌上花 回答

視頻都是沒辦法在移動(dòng)端知道播放的
https://github.com/o2team/H5S...

赱丅呿 回答

為什么要弄兩個(gè)spider呢?你完完全全可以在第一個(gè)spider下再寫一個(gè)parse_shuping_two啊.


對(duì)你的代碼稍作了修改,可以達(dá)到你的要求(別忘了在settings.py中加上ITEM_PIPELINES = {'ysw.pipelines.YswPipeline': 300}以激活pipeline):
spiders/shuping.py

# -*- coding: utf-8 -*-
import scrapy
from scrapy.http import Request
from ysw.items import YswItem, YswItems
import json
from scrapy import Selector
import re


class ShupingSpider(scrapy.Spider):
    name = 'shuping'
    #allowed_domains = ['www.yousuu.com']
    start_urls = ['http://www.yousuu.com/book/124600']

    #此方法解析評(píng)論第一頁(yè)的一級(jí)書評(píng)
    def parse(self, response):

        #遍歷每個(gè)一級(jí)書評(píng),獲得信息
        for r in response.xpath('//*[@id="content"]/div'):
            item = YswItem()

            #發(fā)帖時(shí)間
            item['time'] = r.xpath('string(./div/div/div[1]/div/span[2])').extract_first().strip()

            #獲得贊同數(shù)
            agree = r.xpath('string(./div/div/div[2]/button[1]/span)').extract_first().strip()
            if agree:
                item['agree'] = agree
            else:
                item['agree'] = '0'

            #一級(jí)書評(píng)內(nèi)容
            item['fir_text'] = r.xpath('string(./div/div/p)').extract_first().replace('\r\n', '').replace(' ', '')

            #二級(jí)評(píng)論數(shù):
            sec_num = r.xpath('string(./div/div/div[2]/button[2]/span)').extract_first().strip()
            if sec_num:
                item['sec_num'] = sec_num

                #獲取二級(jí)評(píng)論url的組成部分cid
                cid = r.xpath('./@cid').extract_first().strip()

                #補(bǔ)全二級(jí)評(píng)論第一頁(yè)的url
                sec_text_url = "http://www.yousuu.com/ajax/getonecomment?render=true&cid={}".format(cid)

                #將每一個(gè)一級(jí)書評(píng)下的所有二級(jí)書評(píng)的獲取都交給sp_two.parse
                sec_text_list = []
                yield Request(sec_text_url, meta={'sec_text_list':sec_text_list, 'item':item}, callback=self.parse_shuping_two)
            else:
                item['sec_num'] = '0'
                yield item
        return print('一級(jí)書評(píng)第一頁(yè)!')

    def parse_shuping_two(self, response):
        items = YswItems()

        # json格式轉(zhuǎn)為python結(jié)構(gòu)數(shù)據(jù)
        jsobj = json.loads(response.body)

        # 從字典中提取html的值,也就是二級(jí)評(píng)論的html格式文本
        html = jsobj['html']

        # 獲得二級(jí)書評(píng)第一頁(yè)的所有二級(jí)書評(píng)內(nèi)容,放在列表result中,迭代這個(gè)parse方法時(shí),依次是第2,3,頁(yè)等等
        result = Selector(text=html).xpath('//p/text()').extract()

        # 獲得上一個(gè)Request傳遞過來(lái)的參數(shù), 第一次是一個(gè)空列表
        sec_text_list = response.meta['sec_text_list']

        # 獲得shuping.parse()傳來(lái)的item
        item = response.meta['item']

        '''每一頁(yè)的二級(jí)評(píng)論內(nèi)容放在一個(gè)列表result中,這個(gè)列表又放在列表sec_text_list中
        二級(jí)書評(píng)每一頁(yè)的第一個(gè)書評(píng)都是它的一級(jí)書評(píng)內(nèi)容,所以從每一頁(yè)新的二級(jí)書評(píng)從第二個(gè)算起'''
        sec_text_list.extend(result[1:])

        # 判斷二級(jí)評(píng)論是否還有下一頁(yè)
        nextpage = Selector(text=html).xpath('//a[text()="更多回復(fù)"]/@onclick').extract_first()
        if nextpage:
            # 獲得下一頁(yè)的cid
            cid = re.search(r"(.*?)'(.*?)',(.*)", nextpage).group(2)
            # 獲取下一頁(yè)的t
            t = re.search("(.*),(.*?)\)", nextpage).group(2)
            # 組裝二級(jí)評(píng)論下一頁(yè)的url
            next_page_url = "http://www.yousuu.com/ajax/getcommentreply?cid={}&t={}&render=true".format(cid, t)
            # print('next_page_url')
            # 迭代這個(gè)方法繼續(xù)獲得下一頁(yè)的二級(jí)評(píng)論內(nèi)容
            yield Request(next_page_url, meta={'sec_text_list': sec_text_list, 'item': item}, callback=self.parse_shuping_two)
        else:

            items['sec_text'] = sec_text_list
            items['time'] = item['time']
            items['agree'] = item['agree']
            items['sec_num'] = item['sec_num']
            items['fir_text'] = item['fir_text']

            print('已獲取此一級(jí)書評(píng)的全部二級(jí)書評(píng)!')

            yield items

pipelines.py

# -*- coding: utf-8 -*-
import os

class YswPipeline(object):
    def process_item(self, item, spider):

        base_dir = os.getcwd()
        file_name = base_dir + '/SP.txt'

        with open(file_name, 'a', encoding='utf-8') as f:
            if item['sec_num'] == '0':
                f.write('時(shí)間:' + item['time'] + '\n'
                    '贊同數(shù):' + item['agree'] + '\n'
                    '二級(jí)評(píng)論數(shù)量:' + item['sec_num'] + '\n'
                    '一級(jí)評(píng)論內(nèi)容:' + item['fir_text'] + '\n\n'
                    )
            else:
                f.write('時(shí)間:' + item['time'] + '\n'
                    '贊同數(shù):' + item['agree'] + '\n'
                    '二級(jí)評(píng)論數(shù)量:' + item['sec_num'] + '\n'
                    '一級(jí)評(píng)論內(nèi)容:' + item['fir_text'] + '\n'
                    '二級(jí)評(píng)論內(nèi)容:' + '\n'.join(item['sec_text']) + '\n\n'
                    )
        return item
嫑吢丕 回答

navigator.mediaDevices.getUserMedia({audio:true})
文檔

需要 tls 加密的網(wǎng)頁(yè)才有權(quán)限執(zhí)行

替身 回答

多看看MDN官網(wǎng)就好,Array.prototype.map

使勁操 回答

你好,短視頻功能是需要進(jìn)行授權(quán)的,授權(quán)需要聯(lián)系商務(wù)。
短視頻快速接入指南:https://developer.qiniu.com/v...
clipboard.png

六扇門 回答

你這項(xiàng)目是PC端還是App?如果是App,我倒是踩過這種坑,知道怎么解決?如果是PC端的,那我也不清楚了。沒寫過pc端的頁(yè)面。

款爺 回答

FormData了解一下?blob了解一下?

這個(gè)時(shí)候就要推薦一下我自己的文章了前端文件上傳-javascript-ajax

我先來(lái)幫你分析一番?,F(xiàn)在普遍分為兩種情況。
古老型,圖標(biāo)和內(nèi)容一起提交。前端不需要關(guān)注地址是什么傳到哪里,后端每次都需要自己接收?qǐng)D片,存圖片。
分離型,專門的圖片上傳服務(wù)。圖片可以分用途傳到對(duì)應(yīng)后臺(tái)、模塊、CDN上。后端不關(guān)注傳什么圖片,圖片怎么傳,只需要圖片的url。

悶騷型 回答
# 路徑
# from flask.blueprints import Blueprint
# 然后看下其中的這個(gè)方法
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
  """A helper method to register a rule (and optionally a view function)
  to the application.  The endpoint is automatically prefixed with the
  blueprint's name.
  """
  if self.url_prefix:
    rule = self.url_prefix + rule
  options.setdefault('subdomain', self.subdomain)
  if endpoint is None:
    endpoint = _endpoint_from_view_func(view_func)
  defaults = self.url_defaults
  if 'defaults' in options:
    defaults = dict(defaults, **options.pop('defaults'))
  self.app.add_url_rule(rule, '%s.%s' % (self.blueprint.name, endpoint),
                        view_func, defaults=defaults, **options)
                        
# 所以你1中的路徑需要訪問的是 //api
# 假如 //api 訪問不到的話,需要看下你是不是做了類似于 /* 的配置

因?yàn)?location.href 已經(jīng)跳轉(zhuǎn)頁(yè)面了

慢半拍 回答

不是你的問題,是翻譯的問題,你可以看那個(gè)博客的原文,原文push的是一個(gè)對(duì)象,這個(gè)對(duì)象有兩個(gè)屬性,一個(gè)context,一個(gè)callingContext,所以pop一次就夠了:

clipboard.png

心上人 回答

rem得配合媒介查詢,你設(shè)置媒介查詢了嗎

詆毀你 回答

就直接用table把數(shù)據(jù)渲染出來(lái)就行了,反正我以前就這么弄得

請(qǐng)教了好多人,感覺都沒有好的答案,只有一個(gè)答案感覺還可以,不過是無(wú)法解決這個(gè)問題:

說(shuō)是微信的這個(gè)返回按鈕,開始和瀏覽器沒關(guān)系,必須對(duì)頁(yè)面有操作才能是這個(gè)按鈕與瀏覽器產(chǎn)生關(guān)系,也就是說(shuō)一開始這個(gè)返回按鈕就是返回聊天窗口的。

如果有哪位朋友知道更好的解決辦法,還望共享一下

瘋浪 回答

找到問題了 mongoengine bug

我使用的是 flask-mongoengine 1.11版本 / mongoengine 版本是0.15

我把mongoengine 升級(jí)到 0.15.3。就好了。好了。。。

以上就沒出現(xiàn)問題了 正常查詢到結(jié)果。

孤巷 回答

scrollTop是一個(gè)html 元素的屬性。
Element.scrollTop

clipboard.png

補(bǔ)充:
animate包含了style屬性和一些非style屬性,比如:scrollTop,scrollLeft 等。

In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated.

jQuery.animate

短嘆 回答

寫完發(fā)現(xiàn)寫反了。。。我寫的回車觸發(fā)點(diǎn)擊,你自己改一改就ok
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <button id="btn" onclick="alert('點(diǎn)擊');">回車觸發(fā)點(diǎn)擊</button>
</body>
<script type="text/javascript">

    document.addEventListener("keydown", function() {
        if(event.keyCode == 13) {
            var e=document.createEvent("MouseEvents");
            e.initMouseEvent("click", true, true, document.defaultView, 0, 0, 0, 0, 0,false, false, false, false, 0, null); 
            var btn = document.getElementById("btn"); 
            btn.dispatchEvent(e);
        }
    })
    
</script>

</html>