#提取下一页链接
from selenium import webdriver
from lxml import etree
#启动浏览器
cb = webdriver.Chrome() #cb就是浏览器
cb.get('http://angelimg.spbeen.com/') #get就是访问这个地址
html = cb.page_source #提取网页,当前网页的代码
#现在有了网页代码,下一步就提取图片地址
htmlobj = etree.HTML(html) #把网页做一个解析,变成html对象,有对象就能提取内容
#将html字符串解析成html对象
next_link = htmlobj.xpath('.//a[@class="ch next"]/@href') #xpath 提取内容
if next_link:
link = next_link[0]
print('下一页:', link)
else:
print('没有获取下一页')
重点要理解
xpath('.//a[@class="ch next"]/@href')
这部分知识需要学习补充?