求助!抓取动态网页时出现奇怪的输出结果

在使用post方式抓一个动态网页的js内容,输出结果没有报错,但出现了一个奇怪的输出结果:

图片说明

我要爬的网站是:http://wzzxbs.mofcom.gov.cn/WebProSP/app/infoPub/entpAudit
图片说明

使用的代码如下:

import urllib

def http_post():
    url = 'http://wzzxbs.mofcom.gov.cn/WebProSP/infoPub/audit/loadAuditData.action'
    values = {
            'params.entpName': '',
            'page.currentPage': '1',
            'page.limit': '20',
            'page.option': 'next',
            'page.start': '0',
            'page.rowCount': '2051465',
            'listGrid.col': '1:showAuditInfo(0),2,3,4',
            'listGrid.type': 'link,ro,ro,ro'
            }
    head = {
        'Accept': 'application/json, text/javascript, */*',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'zh-CN,zh;q=0.9',
        'Connection': 'keep-alive',
        'Content-Length': '168',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Cookie': 'sto-id-20480=AGBEFINDJBBP',
        'Host': 'wzzxbs.mofcom.gov.cn',
        'Origin': 'http://wzzxbs.mofcom.gov.cn',
        'Referer': 'http://wzzxbs.mofcom.gov.cn/WebProSP/app/infoPub/entpAudit',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
        'X-Requested-With':' XMLHttpRequest'
        }

    jdata = urllib.parse.urlencode(values).encode("utf-8")
    req = urllib.request.Request(url, jdata, headers = head)  
    response = urllib.request.urlopen(req)  
    return response.read()   

resp = http_post()
print(resp)

不知道具体是什么原因出了问题,希望大佬指点!感谢!

←如果以下回答对你有帮助,请点击右边的向上箭头及采纳下答案

建议不要用urllib这个库,用requests这个库会好很多

import requests
def http_post():
    url = 'http://wzzxbs.mofcom.gov.cn/WebProSP/infoPub/audit/loadAuditData.action'
    values = {
            'params.entpName': '',
            'page.currentPage': '1',
            'page.limit': '20',
            'page.option': 'next',
            'page.start': '0',
            'page.rowCount': '2051465',
            'listGrid.col': '1:showAuditInfo(0),2,3,4',
            'listGrid.type': 'link,ro,ro,ro'
            }
    head = {
        'Accept': 'application/json, text/javascript, */*',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'zh-CN,zh;q=0.9',
        'Connection': 'keep-alive',
        'Content-Length': '168',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Cookie': 'sto-id-20480=AGBEFINDJBBP',
        'Host': 'wzzxbs.mofcom.gov.cn',
        'Origin': 'http://wzzxbs.mofcom.gov.cn',
        'Referer': 'http://wzzxbs.mofcom.gov.cn/WebProSP/app/infoPub/entpAudit',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
        'X-Requested-With':'XMLHttpRequest'
        }

    s=requests.session()
    s.headers.update(head)
    req=s.post(url=url,data=values,verify=False).text
    return req

resp = http_post()
print(resp)