本文实例讲述了Python实现的爬取百度贴吧图片功能。分享给大家供大家参考,具体如下:
#coding:utf-8
import requests
import urllib2
import urllib
```
from lxml import etree
class Tieba:
def __init__(self):
self.tiebaName = raw_input("请输入需要爬取的贴吧:")
self.beginPage = int(raw_input("请输入爬取的起始页:"))
self.endPage = int(raw_input("请输入爬