u010025237
星期墨
2017-10-12 01:08

Python爬取壁纸提示You don't have permission to access

  • python

网址输入到电脑端会直接跳出下载框,不知道用代码怎么实现,
代码如下
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">


403 Forbidden

Forbidden

You don't have permission to access /down/1920x1080_88601.html
on this server.


  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答