|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 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属性的内容,但是爬出来时空白列表,麻烦各位大神帮忙看看,是哪里的问题?非常感谢
|
|