[本文出自天外归云的博客园] 从64365网站获取全国各地律师电话号,用到了python的lxml库进行对html页面内容的解析,对于xpath的获取和正确性校验,需要在火狐浏览器安装firebug和firepath插件.页面内容如下(目标是爬“姓名+电话”): 代码如下: # coding:utf-8 from lxml import etree import requests,lxml.html,os class MyError(Exception): def __init__(self,…