【发布时间】:2019-08-24 14:56:16
【问题描述】:
我现在从事 django 和网络编程。 我正在尝试制作一个显示另一个网站的搜索结果的练习网站。我使用 $requests$ 来获取页面并使用 $Httpresponse$ 来显示页面结果,但结果页面不显示表格和图像。 当我用浏览器打开 html 时有
我不想使用 iframe,因为页面上有一个我不想出现在我的页面中的按钮
def index(request):
...
if request.method == 'POST': # If the form has been submitted...
html=requests.get(url).text
return HttpResponse(html)
加载资源失败:服务器响应状态为 404 (未找到) info-small.png:1
加载资源失败:服务器 响应状态为 404(未找到)(索引):63 未捕获
ReferenceError: $ 未定义 at (index):63 warning-32.png:1 加载资源失败:服务器响应状态为 404 (Not Found) (index):2134
未捕获的引用错误:$ 未定义 at (index):2134 info-small.png:1 加载资源失败:服务器响应状态为 404(未找到)
【问题讨论】:
-
您可以使用漂亮的汤进行网页抓取或Rest api。
标签: python django request frontend