浏览器地址栏输入 http://desk.zol.com.cn/down/1920x1080_88601.html
会跳出下载框
我的
代码如下:
import requests
from bs4 import BeautifulSoup
url="http://desk.zol.com.cn/down/1920x1080_88601.html"
header = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0' }
html=requests.get(url,headers=header)
print(html.text)
输出结果是:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /down/1920x1080_88601.html
on this server.</p>
</body></html>
请问 是代码中的url错了还是什么问题,正确代码该怎么写