|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import urllib.request as u
url='https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E5%A3%81%E7%BA%B8&step_word=&hs=0&pn=0&spn=0&di=7169026086108397569&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=2&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=-1&cs=2538499216%2C780981968&os=2922338267%2C1531596723&simid=30962589%2C742687920&adpicid=0&lpn=0&ln=1977&fr=&fmq=1673969255626_R&fm=result&ic=0&s=undefined&hd=undefined&latest=undefined©right=undefined&se=&sme=&tab=0&width=&height=&face=undefined&ist=&jit=&cg=wallpaper&bdtype=0&oriquery=&objurl=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-06-07%2F5b18f37614638.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Botg9aaa_z%26e3Bv54AzdH3F45ktsj_1jpwts_8908ab_0_z%26e3Bip4s&gsm=1e&rpstart=0&rpnum=0&islist=&querylist=&nojc=undefined&dyTabStr=MCwzLDYsMiwxLDQsNSw3LDgsOQ%3D%3D'
b=u.Request(url)
b.add_header('User-Agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0')
f=u.urlopen(b)
d=f.read().decode('utf-8')
print(d)
print(f.getcode()) # 这个显示200 应该是没问题啊
这是一个百度图片网址,为什么和审查元素结果不一样?有什么解决方法吗? |
|