爬取信息爬不出来
本帖最后由 BigSmall 于 2018-12-16 19:27 编辑代码:
import requests
from lxml import etree
url='https://image.baidu.com/search/index?tn=baiduimage&ct=201326592&lm=-1&cl=2&ie=gb18030&word=%C2%B7%B7%C9&fr=ala&ala=1&alatpl=adress&pos=0&hs=2&xthttps=111111'
r=requests.get(url)
html=etree.HTML(r.text)
hrefs=html.xpath('//div[@class="imgbox"]/a/@href')
print(hrefs)
我想爬取图片中href属性的内容,但是爬出来时空白列表,麻烦各位大神帮忙看看,是哪里的问题?非常感谢
页:
[1]