Python Development [Django]: Composite Search, JSONP, XSS Filtering

Keywords: Python Django JSON Database encoding

Combinatorial search

When doing background blogging, you need to do different searches according to the type of articles.

1. Simple implementation

Associated documents:

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^index.html/$',views.index),
    url(r'^article/(?P<article_type>\d+)-(?P<category>\d+).html/$',views.article)
]
url.py
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>
</head>
<body>
    <h2>Filter condition</h2>


    <div class="condition">
        {% if kwargs.article_type == 0 %}
            <a href="/article/0-{{ kwargs.category }}.html" class="active">whole</a>
        {% else %}
            <a href="/article/0-{{ kwargs.category }}.html">whole</a>
        {% endif %}

        {% for row in article_type %}
            {% if row.id == kwargs.article_type %}
                <a class="active" href="/article/{{ row.id }}-{{ kwargs.category }}.html">{{ row.caption }}</a>
            {% else %}
                <a  href="/article/{{ row.id }}-{{ kwargs.category }}.html">{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <div class="condition">
        {% if kwargs.category == 0 %}
            <a class="active" href="/article/{{ kwargs.article_type }}-0.html">whole</a>
        {% else %}
            <a href="/article/{{ kwargs.article_type }}-0.html">whole</a>
        {% endif %}

        {% for row in category %}
            {% if row.id == kwargs.category %}
                <a class="active" href="/article/{{ kwargs.article_type }}-{{ row.id }}.html">{{ row.caption }}</a>
            {% else %}
                <a href="/article/{{ kwargs.article_type }}-{{ row.id }}.html">{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <h2>Query results</h2>
    <ul>
    {% for row in articles %}
        <li>{{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]</li>
    {% endfor %}
    </ul>
</body>
</html>
article.html

Database structure:

from django.db import models

# Create your models here.

class Categoery(models.Model):
    caption = models.CharField(max_length=16)

class ArticleType(models.Model):
    caption = models.CharField(max_length=16)

class Article(models.Model):

    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)

    category = models.ForeignKey(Categoery)
    article_type = models.ForeignKey(ArticleType)

Processing documents:

from . import  models
def article(request,*args,**kwargs):

    search_dict = {}
    for key,value in kwargs.items():
        kwargs[key] = int(value)        # Converting character types to int types facilitates front-end comparisons such as if a = b
        if value !='0':
            search_dict[key] = value
    articles = models.Article.objects.filter(**search_dict) # A dictionary is a space-time representation of all searches

    article_type = models.ArticleType.objects.all()
    category = models.Categoery.objects.all()

    return render(request,'article.html',{'articles':articles,
                                          'article_type':article_type,
                                         'category':category ,
                                          'kwargs':kwargs})

Note: Implementing this function is not difficult, the most important thing is to clarify the ideas in it. First, we should determine the url access path format http://127.0.0.1:8000/article/0-0.html, the first 0 represents the article_type field, the second 0 represents the category field, if it is zero, it means searching all the information in this field, confirming this is the first step of success, processing the document has a search place. The second key point is to generate the dictionary search_dict for relevant search, if 0 means all search; the third key point is also a very clever way to pass the parameter kwargs to the front end again, which is absolutely magical! ___________

 

2. Another attempt (load memory tuning)

Because the ArticleType type is the data that the blog is destined to die, it will not change later. It can load the data into memory to speed up the query speed.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>
</head>
<body>
    <h2>Filter condition</h2>

    <div class="condition">
        {% if kwargs.article_type_id == 0 %}
            <a href="/article/0-{{ kwargs.category_id }}.html" class="active">whole</a>
        {% else %}
            <a href="/article/0-{{ kwargs.category_id }}.html">whole</a>
        {% endif %}

        {% for row in article_type%}
            {% if row.0 == kwargs.article_type_id %}
                <a class="active" href="/article/{{ row.0 }}-{{ kwargs.category_id }}.html">{{ row.1 }}</a>
            {% else %}
                <a  href="/article/{{ row.0 }}-{{ kwargs.category_id }}.html">{{ row.1 }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <div class="condition">
        {% if kwargs.category_id == 0 %}
            <a class="active" href="/article/{{ kwargs.article_type_id }}-0.html">whole</a>
        {% else %}
            <a href="/article/{{ kwargs.article_type_id }}-0.html">whole</a>
        {% endif %}

        {% for row in category %}
            {% if row.id == kwargs.category_id %}
                <a class="active" href="/article/{{ kwargs.article_type_id }}-{{ row.id }}.html">{{ row.caption }}</a>
            {% else %}
                <a href="/article/{{ kwargs.article_type_id }}-{{ row.id }}.html">{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <h2>Query results</h2>
    <ul>
    {% for row in articles %}
        <li>{{ row.id }}-{{ row.title }}------[{{ row.article_type }}]-[{{ row.category.caption }}]</li>
    {% endfor %}
    </ul>
</body>
</html>
article.html
from django.shortcuts import render
from django.shortcuts import HttpResponse

# Create your views here.

def index(request):


    return HttpResponse('Ok')


from . import  models
def article(request,*args,**kwargs):

    search_dict = {}
    for key,value in kwargs.items():
        kwargs[key] = int(value)        # Converting character types to int Types are easy to do at the front end if a == b  Such a comparison
        if value !='0':
            search_dict[key] = value
    print(kwargs)
    articles = models.Article.objects.filter(**search_dict) # A dictionary is a space-time representation of all searches

    article_type = models.Article.type_choice

    print(article_type)
    category = models.Categoery.objects.all()

    return render(request,'article.html',{'articles':articles,
                                          'article_type':article_type,
                                         'category':category ,
                                          'kwargs':kwargs})
Processing files.py

Database files:

from django.db import models
# Create your models here.
class Categoery(models.Model):
    caption = models.CharField(max_length=16)

# class ArticleType(models.Model):
#     caption = models.CharField(max_length=16)

class Article(models.Model):
    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)

    category = models.ForeignKey(Categoery)
    # article_type = models.ForeignKey(ArticleType)
    type_choice  = [
        (1,'Python'),
        (2,'Linux'),
        (3,'Big data'),
        (4,'Framework'),
    ]
    article_type_id = models.IntegerField(choices=type_choice)

  

3. Using simple_tag to optimize the code

Associated documents:

from django.db import models
# Create your models here.
class Categoery(models.Model):
    caption = models.CharField(max_length=16)

class ArticleType(models.Model):
    caption = models.CharField(max_length=16)

class Article(models.Model):
    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)

    category = models.ForeignKey(Categoery)
    article_type = models.ForeignKey(ArticleType)
    # type_choice  = [
    #     (1,'Python'),
    #     (2,'Linux'),
    #     (3,'Big data'),
    #     (4,'Framework'),
    # ]
    # article_type_id = models.IntegerField(choices=type_choice)
Database file.py
from django.shortcuts import render
from django.shortcuts import HttpResponse

# Create your views here.

def index(request):


    return HttpResponse('Ok')


from . import models
def article(request, *args, **kwargs):
    search_dict = {}
    for key, value in kwargs.items():
        kwargs[key] = int(value)  # Converting character types to int Types are easy to do at the front end if a == b  Such a comparison
        if value != '0':
            search_dict[key] = value
    articles = models.Article.objects.filter(**search_dict)  # A dictionary is a space-time representation of all searches

    article_type = models.ArticleType.objects.all()

    print(article_type)
    category = models.Categoery.objects.all()


    return render(request, 'article.html', {'articles': articles,
                                            'article_type': article_type,
                                            'category': category,
                                            'kwargs': kwargs})
Processing files.py
{% load filter %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>
</head>
<body>
    <h2>Filter condition</h2>
    <div class="condition">
        {% filter_all  kwargs 'article_type'%}

        {% filter_single article_type kwargs 'article_type'%}
    </div>
    <div class="condition">
        {% filter_all  kwargs 'category'%}
        {% filter_single category kwargs 'category'%}
    </div>

    <h2>Query results</h2>
    <ul>
    {% for row in articles %}
        <li>{{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]</li>
    {% endfor %}
    </ul>
</body>
</html>
article.html

Create the template tags directory and create the filter.py file under the directory:

from django import template
from django.utils.safestring import mark_safe
register = template.Library()

@register.simple_tag
def filter_all(kwargs,type_str):
    print(type_str)
    if type_str == 'article_type':
        if kwargs['article_type'] == 0:
            tmp = '<a href = "/article/0-%s.html" class ="active" > whole </a>'%(kwargs['category'])
        else:
            tmp = '<a href = "/article/0-%s.html"> whole </a>'%(kwargs['category'])

    elif type_str == 'category':
        if kwargs['category'] == 0:
            tmp = '<a href = "/article/%s-0.html" class ="active" > whole </a>' % (kwargs['article_type'])
        else:
            tmp = '<a href = "/article/%s-0.html"> whole </a>' % (kwargs['article_type'])

    return mark_safe(tmp)

@register.simple_tag()
def filter_single(type_obj,kwargs,type_str):

    print(type_str)
    tmp = ''
    if type_str == 'article_type':
        for row in type_obj:
            if row.id == kwargs['article_type']:
                tag = '<a class="active" href="/article/%s-%s.html">%s</a>\n'%(row.id,kwargs['category'],row.caption)
            else:
                tag = '<a href="/article/%s-%s.html">%s</a>\n' % (row.id, kwargs['category'],row.caption)
            tmp +=tag
    elif type_str == 'category':
        for row in type_obj:
            if row.id == kwargs['category']:
                tag = '<a class="active" href="/article/%s-%s.html">%s</a>\n' % (kwargs['article_type'],row.id, row.caption)
            else:
                tag = '<a href="/article/%s-%s.html">%s</a>\n' % (kwargs['article_type'], row.id, row.caption)
            tmp += tag

    return mark_safe(tmp)

HTML file body content:

{% load filter %}
<body>
    <h2>Filter condition</h2>
    <div class="condition">
        {% filter_all  kwargs 'article_type'%}

        {% filter_single article_type kwargs 'article_type'%}
    </div>
    <div class="condition">
        {% filter_all  kwargs 'category'%}
        {% filter_single category kwargs 'category'%}
    </div>

    <h2>Query results</h2>
    <ul>
    {% for row in articles %}
        <li>{{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]</li>
    {% endfor %}
    </ul>
</body>

  

JSONP

JSONP(JSON with Padding) is JSON A "usage pattern" can be used to solve cross-domain data access problems in mainstream browsers. Owing to the Same-Origin strategy, web pages located in server1.example.com generally cannot communicate with servers that are not server1.example.com, and the < script > element of HTML is an exception. With the open strategy of < script > elements, web pages can get JSON data generated dynamically from other sources, and this mode of use is called JSONP. The data captured with JSONP is not JSON, but arbitrary JavaScript, which is executed with a JavaScript literal translator rather than parsed with a JSON parser.

Principle:

1. What is homologous strategy?  

Processing documents:

import requests
def jsonp(request):
    # Getting url information
    response = requests.get('http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301') 
    response.encoding = 'utf-8'     # Coding

    return render(request,'jsonp.html',{'result':response.text})  # response.text request content

HTML file:

<body>
    <h1>Background results</h1>
    {{ result }}
    <h1>js Get results directly</h1>
    <input type="button" value="get data" onclick="getContent();" />
    <div id="container"></div>
    <script src="/static/jquery-1.8.2.js"></script>
    <script>
        function getContent() {
            var xhr = new XMLHttpRequest();         // create object
            xhr.open('GET', 'http://Weatherapi.market.xiaomi.com/wtr-v2/weather?CityId=101121301'; //GET mode open
            xhr.onreadystatechange = function () {  // Execution upon receipt of return value
                console.log(xhr.responseText);
            };
            xhr.send()  // Send out
        }
    </script>
</body>

Note: When you click on js to get the result directly, the browser displays the following error information. Because the browser only accepts the information sent from http://127.0.0.1:8000, the information sent from the weather website is directly blocked. This is the homology strategy. Is there any way to solve this problem?

XMLHttpRequest cannot load http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access.

 

2. Skillfully label src attributes with script

script tags are not affected by homologous policies

Processing documents:

import requests
def jsonp(request):
    # Getting url information
    response = requests.get('http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301')
    response.encoding = 'utf-8'     # Coding

    return render(request,'jsonp.html',{'result':response.text})  # response.text request content

def jsonp_api(request):
    return HttpResponse('alert(123)')

HTML file:

<body>
    <h1>Background results</h1>
    {{ result }}
    <h1>js Get results directly</h1>
    <input type="button" value="get data" onclick="getContent();" />
    <div id="container"></div>
    <script>
        function getContent() {
            var tag = document.createElement('script');
            tag.src = '/jsonp_api.html';
            document.head.appendChild(tag);
         //   document.head.removeChild(tag);
        }
    </script>
</body>

Note: js requests for convenience, or request the current program url; after executing the above code, you will find a magical situation, the page will pop up 123 information, indicating that script has succeeded in obtaining information.

 

3. Modify the front and back ends slightly and make the use more dynamic.

Processing documents:

def jsonp(request):

    return render(request,'jsonp.html')  # response.text request content

def jsonp_api(request):
    func = request.GET.get('callback')  # Get the user callback parameter
    content = '%s(10000)'%func          # Execute func (10000) function

    return HttpResponse(content)

HTML file:

<body>
    <h1>Background results</h1>
    {{ result }}
    <h1>js Get results directly</h1>
    <input type="button" value="get data" onclick="getContent();" />
    <div id="container"></div>
    <script>
        function getContent() {
            var tag = document.createElement('script');
            tag.src = '/jsonp_api.html?callback=list';  // Customize callback parameters to achieve tacit understanding with the background
            document.head.appendChild(tag);
         //   document.head.removeChild(tag);
        }
        function list(arg){         // Custom functions correspond to callback=list
               alert(arg);
            }
    </script>
</body>

Note: When js sends a request, take the callback parameter and define the method corresponding to the parameter, the background will pass the data into this method and execute it; as for printing or cartridge, it depends on the user's own needs to deal with; the principle and implementation process of jsonp is the realization of the above code.

 

4. Example application + ajax

Processing documents:

import requests
def jsonp(request):
    response = requests.get('http://www.jxntv.cn/data/jmd-jxtv2.html?callback=list&_=1454376870403')
    response.encoding = 'utf-8'  # Coding

    return render(request, 'jsonp.html', {'result': response.text})  # response.text request content

HTML file:

<body>
    <h1>Background results</h1>
    {{ result }}
    <h1>js Get results directly</h1>
    <input type="button" value="get data" onclick="getContent();" />
    <div id="container"></div>
    <script src="/static/jquery-1.8.2.js"></script>
    <script>
        function getContent() {
            $.ajax({
                url: 'http://www.jxntv.cn/data/jmd-jxtv2.html?callback=list&_=1454376870403',
                type: 'POST',
                dataType: 'jsonp',     // Even if the type written is POST, it is sent according to GET request.
                jsonp: 'callback',
                jsonpCallback: 'list'
            });
        }

        function list(arg){         // Custom functions correspond to callback=list
            console.log(arg);
            var data = arg['data'];
            for(k in data){
                var tr = document.createElement('td');
                var week = data[k]['week'];
                var list = data[k]['list'];
                tr.textContent =week
                document.body.appendChild(tr);
                console.log(week);
                for(i in list){
                    var name = list[i]['name'];
                    console.log(name)
        }}}
    </script>
</body>
list({data:[ { "week":"Sunday", "list":[ { "time":"0030", "name":"Six episodes of the All-Night Theatre", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"<都市现场>60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"<快乐生活一点通>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"<e早晨报>60分钟直播版块", "link":"http://www.jxnt v.cn/live/jxtv2   .shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"<地宝当家>(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"<都市60分>60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "Time": "1300", "time",  " 1 300","name","name","name","name","Who is WinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWinWintime"", "link"":::http:///////////www.jxntv.cn/live/jxtv2.shtml"}, {"time":::::"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/live/jxtv2.shtml""""" "" """""""", "hthththththththththt" hththththththththththtv.cn/live/jxtv2.shtml"}, {time":"1730","name":"Treasure Home >", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"<都市现场>90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"<都市情缘>", "link":"http://www.jxntv .cn /live/jxtv2.shtml" }, { "time":"2 000", "name":"<晚间800>", "link":"http://www.jxntv.cn/live/jxtv2.sh tml" }, { "time":"2020", "name":"<都市剧场>黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"<都市剧场>黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200" "N ame": "n ame": "<shooting a case>", "link": "http:///w w.jxntv.cn/live/jxtv2.shtml"}, {time":///www.jxntv.cn/live/jxtv2.shtml"}, {time:///www.jxntv.cn/live/jxtv2.shtml"""""""", "link":http:////www.jxntv.cn/live/jxtv2.shtml""}, {"time"""{"2250"""""""""""""""name","link""::::::::::::xtv2.shtml"},{week", "Monday", "list": [{time","0030","n ame":"Six episodes of the All-Night Theater Broadcast Continuously ", "l ink":"http://www.jxntv.cn/live/jxtv 2.shtml" }, { "time":"0530", "name":"<都市现 场>60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"<快乐生活一点通>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"<e早晨报>60分钟直播版块", "link":"http://www .jxntv .cn/live/jxtv2.shtml" }, { "time":"0 800", "name":"精选剧场四集 连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"<地宝当家>(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"<都市60分>60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "ti me":"13 00", "name":"<谁是赢家>", "link": "http://www.jxntv .cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"<快乐生活一点通>精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"<地宝当家>", "link":" http://w ww.jxntv.cn/live/jxtv2.shtml" }, { "ti me":"1800" "Name": "Name": "Urban Live 90-minute Live Blocks", "link": "http:///www.jxntv.cn/live/jxtv2.shtml"}, {time":1930","""""""""""""""name"""""""""""""""""""Urban Love"""""""""""""""""""", "link"::://www.jxntv.jxntv.cn/live/jxtv2.shtml"}, {"time"""""""""""""""""""""""""""""""""""""""Live/jxtv2 .shtml"},  {"time": "2020", "name": ""Metropolita n Theatre"Golden Drama (Episode 1) )", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"<都市剧场>黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"<拍案>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230",  "Name": "Jiangxi News Broadcast (replay)", "link": "http:///www.jxntv.cn/live/j xtv2.shtml"}, {time":"2250", {time", {2250","""""""""""""""""","name":"evening theatre of metropolis","link":"http:///www.jxntv.cn/live/list/jxtv2.shshtml.shtml"}]]]}, {""{"""""":Tuesday",,""""""""""""""""""""""""""""""""""""""//www.jxntv.cn/live/j xtv2.shtml"}, {time": "0530", "name": "<urban present" 场>60分 钟精编版(重播)", "link":"http://www.jx ntv.cn/live/jx tv2.shtml" }, { "time":"0630", "name":"<快乐生活一点通>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"<e早晨报>60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "lin TreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTreTre Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Trere rererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererererer erer erererererererererererererererererererererererererererererererererererererererererererererererererererererererererejxntv.jxntv.jxntv.cn.cn/ live/jxtvvvvv.cn/live/jxtxtvvvvvvv.cn/live/jxtcn/live/jxtv2.shtml"}, {"time": "1400", "name": "three episodes of women's theatre serials" "Link": "htttp:////www.jxntv.hthtttp:////www.jxntv.jxntv.cn/live/j xtv2. shtml"}, {"time": "1700",""name": {"time"",,,""1700",,"""""""""Have a HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHahttttttp:///www.jxntntv.jxntv.cn/live/ jxtv2.cn/live/jxtv2.shshtmtml,"""""""""""""""""""""""htttp:///////www{Time": "1800", "Name": "Urban Live 90 Minutes Live Block", "Link": "http://www.jxntv" .cn/live/jxtv2.shtml" }, { "time":"1930", "nam e":"< 都市情缘>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"<晚间800>", "link":"http://www.jxntv.cn/live/jxtv2 .shtml" }, { "time":"2020", "name":"<都市剧场>黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "na me":"<都市剧场>黄金剧(第2集)", "link":"http://www. jxntv. cn/live/jxtv2.shtml" }, { "time":"2200", "name":"<拍案>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新 闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://ww w.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周三", "list":[ { "ti me":"00 30", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"<都市现场>60分钟精编 版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"<快乐生活一点通>", "link" Htttp:////www.jxntv.cn/live/jxtv2.shtml""}, {time"""time":::time""::::Time":: :"time": ::"time":::"time":::::""""time"""""""""""""""""""time"///www.jxntv.cn/live/jxtv2.jxtv2.shtml"""""""":httttp://///www.www.jxxntv.jxntv.cn/live/l ive/jxtv2.jxtv2.jxtv2.shshtml""""""""""Time", "1120", "name", "Treasure Home" (replay), "link": "http://www.jxntv.cn/live/j" xtv2.shtml" }, { "time":"1200", "name":"<都市60分>60分钟直播版 块", "lin k":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"<谁是赢家>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time" :"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name": "Happy Living a Happy Life is a master edition", "link": "http:///www.jxntv .cn/live/jx tv2.shtml"}, {time",{time""""""""1730",""name""","Treasure Home",,"""""","link":http:///www.jxntv.cn/live/jxtv2.cn/live/jxtv2.shtml"""""""""""""" """"""""{"time"":1800","""""""""""""""""""""""""""""""""""/ jxtv2.shtml"}, {time": "1930", "name", "urban love", "lin" k":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"< 晚间800>",  "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"<都市剧场>黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv 2.shtml" }, { "time":"2110", "name":"<都市剧场>黄金剧(第2集)", "link":"http://www.jxntv.cn /live/jxtv2.shtml" }, { "time":"2200", "name":"<拍案>", "link":"http://www.jxntv.cn/li ve/jxtv2.shtml " }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧 场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周四", "list":[ { "time":"00 30", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" },  { "time":"0530" "Name": "name": "<urban scene>60 minutes edition (replay)", "link": "http:///www.jxntv.cn/live/jxtv2.shtml"}, {"time": "0630",""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""":://www.jxntv.jxntv.cn/live/jxtv2.shtml"""""""jxntv.cn/live/jxtv2.shtml"}, {time": "0800", "name": "Select ed Theatre" 四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"<地宝当家>(重播)", "link":"http://www.jxntv.cn/live /jxtv2.shtml" }, { "time":"1200", "name":"<都市60分>60分钟直播版 块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"<谁是赢家>", "link":"http://www.j xntv.cn/live /jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"<快 乐生活一点通>精编版", "link":"http://www.jxntv.cn/live/j xtv2.shtml" }, { "time":"1730", "name":"<地宝当家>", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "Name": "<Urban Live>90-minute Live Blocks",""link":http:///www.jxntv.cn/live/jxtv2.shtml"},{time""1930",""""""""name""""""""""""name": "<urban romance",,"""link":http://www.jxntv.cn/live/jxtv2.cn/live/jxtv2.shtml"}, {time""""""""""""""2000"""""""""""""""""""""<evening 800name>""""""""""""""/jxtv2.shtml"}, {time": "2020", "name": "<City Theatre > Golden Drama (Episode 1)," "link": "http" ://www.jxntv.c n/live/jxtv2.shtml"}, {time":"2110",""name": <metropolitan theatre> golden drama (episode 2)," "link":"http://www.jxntv.cn/live/jxtv2.shtml"}
Data Obtained by Website

Note: The process of implementation is the same as the code written by the 3rd person. It is also to create a script and then delete it.

Posted by nrussell on Mon, 01 Apr 2019 18:27:29 -0700