python爬虫学习 2.4 (使用Xpath得案例) 啥都不说了,直接看代码吧 # coding=utf-8 import requests from lxml import etree import json class TiebaSpider: def __init__(self,tieba_name): self.tieba_name = tieba_name self.start_url = "http://tieba.baidu.com/mo/q----,sz@320_240-1-3---2/m?kw="+tieba_name+"&pn=0"