精华内容
下载资源
问答
  • Splash

    2019-10-28 13:42:13
    Splash
  • splash

    2019-03-27 14:16:00
    function main(splash, args) splash.images_enabled = false //不加载图片 assert(splash:go(args.url)) assert(splash:wait(1.5)) return { html = splash:html(), png = splash:png(), ...
    function main(splash, args)
      splash.images_enabled = false //不加载图片
      assert(splash:go(args.url))
      assert(splash:wait(1.5))
    
      return {
        html = splash:html(),
        png = splash:png(),
        har = splash:har(),
      }
    end
    

      

     

    <form id="login" action="/login">
        <input type="text" name="username" />
        <input type="password" name="password" />
        <input type="checkbox" name="remember" />
        <button type="submit">Submit</button>
    </form>
    
    function main(splash)
        -- ...
        local form = splash:select('#login')
        assert(form:fill({ username='admin', password='pass', remember=true }))
        assert(form:submit())
        -- ...
    end
    

      

     

     

    function main(splash, args)
      splash:set_viewport_size(800, 600)
      splash:set_user_agent('Splash bot')
      local example_urls = {"www.google.com", "www.bbc.co.uk", "scrapinghub.com"}
      local urls = args.urls or example_urls
      local results = {}
      for _, url in ipairs(urls) do
        local ok, reason = splash:go("http://" .. url)
        if ok then
          splash:wait(0.2)
          results[url] = splash:png()
        end
      end
      return results
    end
    

      

    function main(splash, args)
      splash:set_user_agent('Mozilla') 
      splash:add_cookie("_ujz", "MTc3ODc5Nzkw", "/", ".51job.com")
        
      assert(splash:go(args.url))
      assert(splash:wait(0.5))
    
      return {
        html = splash:html(),
        png = splash:png(),
        har = splash:har(),
      }
    end
    

      

     

    转载于:https://www.cnblogs.com/ahuo/p/10607205.html

    展开全文
  • scrapy-splash简单使用

    万次阅读 2020-06-03 10:04:33
    scrapy-splash简单使用: 1.docker安装splash docker info 查看docker信息 docker images 查看所有镜像 docker pull scrapinghub/splash 安装scrapinghub/splash docker run -p 8050:8050 scrapinghub/splash &...

    scrapy-splash简单使用:
        1.docker安装splash
        docker info 查看docker信息
        docker images  查看所有镜像
        docker pull scrapinghub/splash  安装scrapinghub/splash
        docker run -p 8050:8050 scrapinghub/splash &  指定8050端口运行

        2.pip install scrapy-splash

        3.scrapy 配置:
        SPLASH_URL = 'http://localhost:8050'
        DOWNLOADER_MIDDLEWARES = {
           'scrapy_splash.SplashCookiesMiddleware': 723,
           'scrapy_splash.SplashMiddleware': 725,
           'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810,
        }
        SPIDER_MIDDLEWARES = {
            'scrapy_splash.SplashDeduplicateArgsMiddleware': 100,
        }
        DUPEFILTER_CLASS = 'scrapy_splash.SplashAwareDupeFilter'
        HTTPCACHE_STORAGE = 'scrapy_splash.SplashAwareFSCacheStorage'

        4.scrapy 使用
        from scrapy_splash import SplashRequest
        yield SplashRequest(self.start_urls[0], callback=self.parse, args={'wait': 0.5})

     

    测试代码:

    import datetime
    import os
    
    import scrapy
    from scrapy_splash import SplashRequest
    
    from ..settings import LOG_DIR
    
    
    class SplashSpider(scrapy.Spider):
        name = 'splash'
        allowed_domains = ['biqugedu.com']
        start_urls = ['http://www.biqugedu.com/0_25/']
    
        custom_settings = {
            'LOG_FILE': os.path.join(LOG_DIR, '%s_%s.log' % (name, datetime.date.today().strftime('%Y-%m-%d'))),
            'LOG_LEVEL': 'INFO',
            'CONCURRENT_REQUESTS': 8,
            'AUTOTHROTTLE_ENABLED': True,
            'AUTOTHROTTLE_TARGET_CONCURRENCY': 8,
    
            'SPLASH_URL': 'http://localhost:8050',
            'DOWNLOADER_MIDDLEWARES': {
                'scrapy_splash.SplashCookiesMiddleware': 723,
                'scrapy_splash.SplashMiddleware': 725,
                'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810,
            },
            'SPIDER_MIDDLEWARES': {
                'scrapy_splash.SplashDeduplicateArgsMiddleware': 100,
            },
            'DUPEFILTER_CLASS': 'scrapy_splash.SplashAwareDupeFilter',
            'HTTPCACHE_STORAGE': 'scrapy_splash.SplashAwareFSCacheStorage',
    
        }
    
        def start_requests(self):
            yield SplashRequest(self.start_urls[0], callback=self.parse, args={'wait': 0.5})
    
        def parse(self, response):
            """
            :param response:
            :return:
            """
            response_str = response.body.decode('utf-8', 'ignore')
            self.logger.info(response_str)
            self.logger.info(response_str.find('http://www.biqugedu.com/files/article/image/0/25/25s.jpg'))
    

     

    scrapy-splash接收到js请求:

     

    展开全文
  • Raindrop Splash

    2019-10-28 21:24:09
    Raindrop Splash
  • Splash安装包

    2018-11-14 20:11:22
    splash 影音播放器绿色版是一款专为解码全高清(UltraHD)影片而打造的高级视频播放器,支持最新主流 CPU 与 GPU 硬件加速技术。Splash Pre 结合包括英伟达 CUDA 和英特尔 Quick Sync 硬件视频解码加速在内的最新...
  • Splash Pages

    2020-12-31 14:54:19
    <div><p>Need to provide capabilities for Splash Page generation http://wet-boew.github.com/wet-boew/demos/theme-gcwu-fegc/index-eng.html#splash</p>该提问来源于开源项目:wet-boew/wet-boew-drupal...
  • Splash screen

    2020-12-08 20:30:09
    <div><p>Is there a way to remove the splash screen? Perhaps some shortcut command? Wrye Bash is taking up to two minutes to load here, and I cant use my computer with the splash screen on top of ...
  • Splash package

    2020-12-25 22:16:24
    m having some issues trying to add a splash package to the generated documentation. My company just migrated from enunciate 1x to 2x and noticed that there isn't an option for splash package was ...
  • SplashScreen-源码

    2021-03-20 07:22:27
    SplashScreen

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 14,378
精华内容 5,751
关键字:

splash