res=self.request_base('select_api',change_data=change_data)
print("=============================")
req_html=''
for chunk in res.iter_lines():
req_html += chunk.decode('utf-8')
print(req_html)
res.text打印的内容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="nojs" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>测试比对样品 - 稿件管理</title>
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px
}
<script type="text/javascript">
// <![CDATA
// ]]>
</script>
<style type="text/css">
/* <![CDATA[ */
padding: 0.52em 0.6em 0.53em;
}
background: url(/image/company_logo?img_id=11926&t=1722935020395) no-repeat;
display: block;
font-size: 0;
height: 51px;
text-indent: -9999em;
width: 636px;
}
/* ]]> */
</style>
</head>
<body class="blue controls-hidden">
<div id="wrapper">
<div id="banner">
<h1 class="logo">
<a class="png" href="http://127.0.0.1:8088">测试比对样品</a>
</h1>
<div class="lfr-dock interactive-mode">
<h2 class="user-greeting">
<span>Welcome test01!</span>
</h2>
<ul class="lfr-dock-list">
<li class="sign-out">
<a href="/c/portal/logout">退出</a>
</li>
</ul>
</div>
</div>
<div id="navigation" class="sort-pages modify-pages">
<ul>
<li class="selected">
<a href="/group/10779/articles" ><span>稿件管理</span></a>
</li>
<li class="">
<a href="/group/10779/upload" ><span>文档上传下载</span></a>
</li>
</ul>
</div>
<div class="portlet" id="portlet-wrapper-15">
<div class="portlet-topper">
<span class="portlet-title">
稿件管理
</span>
<div class="portlet-icons" id="portlet-small-icon-bar_15">
<a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=normal" class="portlet-icon-back">返回首页</a>
</div>
</div>
<div class="portlet-content">
</div>
<div id="footer"></div>
</div>
</body>
</html>
流式处理响应的打印内容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html class="nojs" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"><head><title>测试比对样品 - 稿件管理</title><meta content="text/html; charset=UTF-8" http-equiv="content-type" /><link rel="Shortcut Icon" href="/html/themes/classic/images/liferay.ico" /><link href="/c/portal/css_cached?themeId=classic&colorSchemeId=01&t=1722930515004" type="text/css" rel="stylesheet" /><link href="/html/portlet/journal/css.jsp?themeId=classic&colorSchemeId=01&t=1722930508507" rel="stylesheet" type="text/css" /><style type="text/css">#p_p_id_15_ .portlet {margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px}</style><script type="text/javascript"></script><script src="/html/js/everything_packed.js?bn=5101" type="text/javascript"></script><script type="text/javascript"></script><link class="lfr-css-file" href="/html/themes/classic/css/everything_packed.css?companyId=1&languageId=zh_CN&themeId=classic&colorSchemeId=01&t=1722930515004" id="mainLiferayThemeCSS" rel="stylesheet" type="text/css" /><script class="lfr-script-file" id="mainLiferayThemeJavaScript" src="/html/themes/classic/javascript/javascript.js?t=1722930515004" type="text/javascript"></script><script type="text/javascript"></script><style type="text/css">/* <![CDATA[ */#banner .logo {padding: 0.52em 0.6em 0.53em;}#banner .logo a {background: url(/image/company_logo?img_id=11926&t=1722935020395) no-repeat;display: block;font-size: 0;height: 51px;text-indent: -9999em;width: 636px;}/* ]]> */</style></head><body class="blue controls-hidden"><div id="wrapper"><div id="banner"><h1 class="logo"><a class="png" href="http://127.0.0.1:8088">测试比对样品</a></h1><div class="lfr-dock interactive-mode"><h2 class="user-greeting"><span>Welcome test01!</span></h2><ul class="lfr-dock-list"><li class="sign-out"><a href="/c/portal/logout">退出</a></li></ul></div></div><div id="navigation" class="sort-pages modify-pages"><ul><li class="selected"><a href="/group/10779/articles" ><span>稿件管理</span></a></li><li class=""><a href="/group/10779/upload" ><span>文档上传下载</span></a></li></ul></div> <div class="columns-max" id="content-wrapper"><div class="lfr-column" id="column-1"><div id="p_p_id_15_" class="portlet-boundary portlet-boundary_15_ portlet-journal" ><a name="p_15"></a><div class="portlet" id="portlet-wrapper-15"><div class="portlet-topper"><span class="portlet-title"><img alt="" src="/html/portlet/journal/icon.png" /> 稿件管理</span><div class="portlet-icons" id="portlet-small-icon-bar_15"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=normal" class="portlet-icon-back">返回首页</a></div></div><div class="portlet-content"><div class="portlet-content-container" style=""><div><script type="text/javascript">function _15_deleteArticles() {if (confirm('\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u9009\u62e9\u7684\u6587\u7ae0\u5417\u003f')) {document._15_fm._15_cmd.value = "delete";document._15_fm._15_groupId.value = "10780";document._15_fm._15_deleteArticleIds.value = Liferay.Util.listCheckedExcept(document._15_fm, "_15_allRowIds");submitForm(document._15_fm, "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles");}}function _15_deleteFeeds() {if (confirm('\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u9009\u62e9\u7684\u9972\u6599\u5417\u003f')) {document._15_fm._15_cmd.value = "delete";document._15_fm._15_groupId.value = "10780";document._15_fm._15_deleteFeedIds.value = Liferay.Util.listCheckedExcept(document._15_fm, "_15_allRowIds");submitForm(document._15_fm, "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_feed&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles");}}function _15_deleteStructures() {if (confirm('\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u9009\u62e9\u7684\u7ed3\u6784\u5417\u003f')) {document._15_fm._15_cmd.value = "delete";document._15_fm._15_groupId.value = "10780";document._15_fm._15_deleteStructureIds.value = Liferay.Util.listCheckedExcept(document._15_fm, "_15_allRowIds");submitForm(document._15_fm, "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_structure&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles");}}function _15_deleteTemplates() {if (confirm('\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u9009\u62e9\u7684\u6a21\u677f\u5417\u003f')) {document._15_fm._15_cmd.value = "delete";document._15_fm._15_groupId.value = "10780";document._15_fm._15_deleteTemplateIds.value = Liferay.Util.listCheckedExcept(document._15_fm, "_15_allRowIds");submitForm(document._15_fm, "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_template&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles");}}function _15_expireArticles() {if (confirm('\u662f\u5426\u786e\u5b9e\u8981\u5230\u671f\u9009\u62e9\u7684\u6587\u7ae0\u5417\u003f')) {document._15_fm._15_cmd.value = "expire";document._15_fm._15_groupId.value = "10780";document._15_fm._15_expireArticleIds.value = Liferay.Util.listCheckedExcept(document._15_fm, "_15_allRowIds");submitForm(document._15_fm, "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles");}}</script><form action="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles" method="post" name="_15_fm" onSubmit="submitForm(this); return false;"><input name="_15_cmd" type="hidden" value="" /><input name="_15_tabs1TabsScroll" type="hidden" /><ul class="tabs ui-tabs"><li class="current first last" id="_15_tabs1articlesTabsId"><span>稿件</span></li></ul><script type="text/javascript">Liferay.Portal.Tabs.show("_15_tabs1", ['articles'], "articles");</script><input name="_15_groupId" type="hidden" value="" /><input name="_15_deleteArticleIds" type="hidden" value="" /><input name="_15_expireArticleIds" type="hidden" value="" /><script type="text/javascript">var toggle_id_journal_article_searchcurClickValue = "basic";function toggle_id_journal_article_searchtoggleSearch() {jQuery("#toggle_id_journal_article_searchbasic").toggle();jQuery("#toggle_id_journal_article_searchadvanced").toggle();var advancedSearchObj = jQuery("#toggle_id_journal_article_searchadvancedSearch");if (toggle_id_journal_article_searchcurClickValue == "basic") {toggle_id_journal_article_searchcurClickValue = "advanced";advancedSearchObj.val(true);}else {toggle_id_journal_article_searchcurClickValue = "basic";advancedSearchObj.val(false);}jQuery.ajax({url: 'portal/session_click',data: {'toggle_id_journal_article_search': toggle_id_journal_article_searchcurClickValue}});}</script><input id="toggle_id_journal_article_searchadvancedSearch" name="_15_advancedSearch" type="hidden" value="false" /><div id="toggle_id_journal_article_searchbasic" style="display: block;"><label for="toggle_id_journal_article_searchkeywords">查询</label><input id="toggle_id_journal_article_searchkeywords" name="_15_keywords" size="30" type="text" value="test2" /> <a href="javascript: toggle_id_journal_article_searchtoggleSearch();" tabindex="-1" >高级 »</a></div><div id="toggle_id_journal_article_searchadvanced" style="display: none;">匹配下列<select name="_15_andOperator"><option selected value="1">所有</option><option value="0">任何</option></select>查询条件:<br /><br /><table class="lfr-table"><tr><td>编号</td><td>版本</td><td>标题</td><td>内容</td></tr><tr><td><input name="_15_searchArticleId" size="20" type="text" value="" /></td><td><input name="_15_version" size="20" type="text" value="" /></td><td><input name="_15_title" size="20" type="text" value="" /></td><td><input name="_15_content" size="20" type="text" value="" /></td></tr></table><br /><a href="javascript: toggle_id_journal_article_searchtoggleSearch();" tabindex="-1">« 基本</a></div><br /><div><input type="submit" value="查询稿件" /><input type="button" value="增加稿件" onClick="_15_addArticle();" /></div><script type="text/javascript">function _15_addArticle() {var url = 'http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles';if (toggle_id_journal_article_searchcurClickValue == 'basic') {url += '&_15_title=' + document._15_fm._15_keywords.value;submitForm(document.hrefFm, url);}else {document._15_fm.method = 'post';submitForm(document._15_fm, url);}}Liferay.Util.focusFormField(document._15_fm._15_searchArticleId);Liferay.Util.focusFormField(document._15_fm._15_keywords);</script><div class="separator"></div><input type="button" value="到期" onClick="_15_expireArticles();" /><input type="button" value="删除" onClick="_15_deleteArticles();" /><br /><br /><div class="taglib-search-iterator-page-iterator-top"><script type="text/javascript">function _15_submitPageIterator() {var curValue = jQuery("option:selected", this).val();if (true) {var href = "http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&cur" + "=" + curValue + "";location.href = href;}else {document._15_fm.cur.value = curValue;null;}}jQuery(function() {jQuery('._15_pageIteratorValue').change(_15_submitPageIterator);});</script><div class="taglib-page-iterator"><div class="search-results">显示1条结果。</div></div></div><div class="results-grid"><table class="taglib-search-iterator"><tr class="portlet-section-header results-header"><th class="col-1"><input name="_15_allRowIds" type="checkbox" onClick="Liferay.Util.checkAll(_15_fm, '_15_rowIds', this);"></th><th class="col-2"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&_15_orderByCol=id&_15_orderByType=desc">编号</a></th><th class="col-3"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&_15_orderByCol=title&_15_orderByType=desc">标题</a></th><th class="col-4"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&_15_orderByCol=version&_15_orderByType=desc">版本</a></th><th class="col-5">状态</th><th class="col-6"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&_15_orderByCol=modified-date&_15_orderByType=asc"><i>修改过的日期</i></a></th><th class="col-7"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fview&_15_tabs1=articles&_15_keywords=test2&_15_advancedSearch=false&_15_andOperator=true&_15_groupId=10780&_15_version=0.0&_15_orderByCol=display-date&_15_orderByType=desc">显示日期</a></th><th class="col-8">作者</th><th class="col-9"> </th></tr><tr class="portlet-section-body results-row"onmouseover="this.className = 'portlet-section-body-hover results-row hover';" onmouseout="this.className = 'portlet-section-body results-row';"><td align="left" class="col-1" colspan="1" valign="middle"><input name="_15_rowIds" type="checkbox" value="54076_version_1.0" onClick="Liferay.Util.checkAllBox(_15_fm, '_15_rowIds', _15_allRowIds);"></td><td align="left" class="col-2" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">54076</a></td><td align="left" class="col-3" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">test2</a></td><td align="left" class="col-4" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">1.0</a></td><td align="left" class="col-5" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">不批准</a></td><td align="left" class="col-6" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">24-8-6 下午5:36</a></td><td align="left" class="col-7" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">24-8-5 下午5:38</a></td><td align="left" class="col-8" colspan="1" valign="middle"><a href="http://127.0.0.1:8088/group/10779/articles?p_p_id=15&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_15_struts_action=%2Fjournal%2Fedit_article&_15_redirect=%2Fgroup%2F10779%2Farticles%3Fp_p_id%3D15%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_15_struts_action%3D%252Fjournal%252Fview%26_15_tabs1%3Darticles&_15_groupId=10780&_15_articleId=54076&_15_version=1.0">User test01</a></td></tr></table></div></form></div></div></div></div><script type="text/javascript">Liferay.Portlet.onLoad({canEditTitle: false,columnPos: 0,isStatic: 'end',namespacedId: 'p_p_id_15_',portletId: '15'});</script></div></div></div><div id="footer"></div></div><form action="" method="post" name="hrefFm"></form><script type="text/javascript">Liferay.Session.init({autoExtend: false,timeout: 30,timeoutWarning: 1,redirectOnExpiration: false});</script></body></html>