Python 日志分析 -> ip、url、pv、useragent

Python 专栏收录该内容
20 篇文章 0 订阅

import datetime
import re
from pathlib import Path

pattern = '''(?P<remote>[\d.]{7,}) - - \[(?P<datetime>[\w/: +]+)\] \
"(?P<method>\w+) (?P<url>\S+) (?P<protocol>[\w\d/.]+)" (?P<status>\d+) (?P<lenth>\d+) \
".+" "(?P<useragent>.+)"'''
regex = re.compile(pattern)

conversion = {'datetime': lambda timestr: datetime.datetime.strptime(timestr, '%d/%b/%Y:%H:%M:%S %z'),
              'status': int,
              'lenth': int,
              'useragent': lambda ua: parse(ua)
              }

def extract(logline: str):
    m = regex.match(logline)
    if m:
        return {k: conversion.get(k, lambda x: x)(v) for k, v in m.groupdict().items()}
    else:
        return None

# 装载日志
def loadfile(filename, encoding='utf8'):
    with open(filename, encoding=encoding) as f:
        for line in f:
            fields = extract(line)
            if fields:
                yield fields
            else:
                continue

# 装载日志文件
def load(*paths, encoding='utf8', ext='*.log', recursive=False):
    for x in paths:
        p = Path(x)
        if p.is_dir():
            if isinstance(ext, str):
                ext = [ext]
            else:
                ext = list(ext)
            for e in ext:
                files = p.rglob(e) if recursive else p.glob(e)
                for file in files:
                    yield from loadfile(file.absolutte(), encoding=encoding)
                    # with file.open(encoding=encoding) as f:
                    #     for line in f:
                    #         fields = extract(line)
                    #         if fields:
                    #             yield fields
                    #         else:
                    #             continue
        elif p.is_file():
            yield from loadfile(p.absolute(), encoding=encoding)
            # with p.open(encoding=encoding) as f:
            #     for line in f:
            #         fields = extract(line)
            #         if fields:
            #             yield fields
            #         else:
            #             continue

from queue import Queue
import threading

# 消息队列, 分发
def dispather(src):
    handlers = []
    queues = []

    def reg(handle):
        q = Queue()
        queues.append(q)

        t = threading.Thread(target=handle, args=(q,))
        handlers.append(t)

    def run():
        for t in handlers:
            t.start()
        for item in src:
            for q in queues:
                q.put(item)
    return reg, run

reg, run = dispather(load('d:/access.log'))	# 随便找了一篇日志

# ip 分析
@reg
def ip_handle(q: Queue):
    ips = {}
    while True:
        data = q.get()
        ip = data.get('remote')
        if ip:
            ips[ip] = ips.get(ip, 0) + 1
        # print(len(ips), ips.keys())
        # print(sorted(ips.items(), key=lambda x: x[1], reverse=True))

# url 分析
from urllib.parse import urlparse

# urls = {
#     'http://www.magedu.com/',
#     '/index.html',
#     '/index.html?id=5&age=20'
# }
# for i, url in enumerate(urls, 1):
#     t = urlparse(url)
#     print(i, url)
#     print(i, t.path)

# PV 分析
@reg
def pv_handle(q: Queue):
    pvs = {}
    while True:
        data = q.get()
        ip = data.get('remote')
        url = data.get('url')
        if ip and url:
            path = urlparse(url).path
            if path not in pvs:
                pvs[path] = {}
            pvs[path][ip] = pvs[path].get(ip, 0) + 1
        # print(pvs)

# useragent 分析
from user_agents import parse

# useragents = [
#     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
#     "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11",
#     "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16"
#
# ]
# for uastring in useragents:
#     ua = parse(uastring)
#     print(ua.browser, ua.browser.family, ua.browser.version, ua.browser.version_string)


@reg
def ua_handle(q: Queue):
    browsers = {}
    while True:
        data = q.get()
        ua = data.get('useragent')
        if ua:
            key = ua.browser.family, ua.browser.version_string
            browsers[key] = browsers.get(key, 0) + 1
        print(browsers)

run()

运行结果

{('Baiduspider', '2.0'): 12, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 30, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 30, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 31, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 32, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 33, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 34, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 35, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 36, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 37, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 38, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 39, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 40, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 41, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 42, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 43, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 44, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 45, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 46, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 47, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 48, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 49, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'): 1, ('IE', '9.0'): 4, ('YandexBot', '3.0'): 22, ('Kazehakase', '0.5.6'): 1, ('Chrome', '45.0.2454'): 6, ('Chrome', '17.0.963'): 1, ('Other', ''): 1, ('Mobile Safari', '10.0'): 61, ('WordPress', '4.5.4'): 1, ('WordPress', '4.5.7'): 1, ('Chrome', '57.0.2987'): 50, ('Chrome Mobile WebView', '53.0.2785'): 49, ('UC Browser', '11.4.8'): 82, ('Chrome Mobile', '57.0.2987'): 96, ('Android', '6.0'): 1, ('QQ Browser Mobile', '7.2'): 42, ('Chrome Mobile', '35.0.1916'): 15, ('Firefox', '52.0'): 1, ('Firefox Beta', '3.0.b4'): 4, ('Chrome', '56.0.2924'): 2, ('Mobile Safari UI/WKWebView', '10.2.1'): 19, ('QQ Browser', '9.5.10548'): 2, ('Mobile Safari', '5.0.2'): 14, ('Mobile Safari', '6.0'): 2, ('Chrome Mobile', '38.0.0'): 27, ('MobileSafari', '602.1'): 16, ('Googlebot-Image', '1.0'): 1, ('Chrome', '47.0.2526'): 2, ('Mobile Safari UI/WKWebView', '10.0.2'): 9, ('Chrome Mobile WebView', '43.0.2357'): 2, ('Chrome Mobile', '53.0.2785'): 4, ('Chrome Mobile', '45.0.2454'): 15, ('Chrome Mobile', '16.0.912'): 1, ('Chrome', '49.0.2623'): 4, ('Chrome', '50.0.2661'): 137}
{('Baiduspider', '2.0'): 13, ('Android', '5.1.1'): 1, ('Sogou Explorer', '1.0'): 121, ('IE', '6.0'): 87, ('Chrome', '35.0.1916'): 5, ('AOL', '9.5.4337'): 1, ('Chrome', '19.0.1036'): 1, ('Opera', '11.52'

截取了部分输出结果

  • 0
    点赞
  • 0
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值