摘要: 首先在这里下载你想用的各个版本的python,我用的是2.7.11: https://www.python.org/ftp/python/ 还是老样子: ./configure --> make --> make install 接下来将你自带的版本替换成自己的版本: 先 which python 阅读全文
posted @ 2016-08-18 15:50 cpc_dingyi 阅读(735) 评论(0) 推荐(0) 编辑
摘要: 今天遇到一个问题,我在爬取一个网页,网页中有table,我直接打开开发者工具,点击源码使用右键Copy Xpath, 然后直接复制上去了,之前使用这个一直没问题,但是今天就是取不到值,我就很疑惑。 查看我的xpath解析:/html/body/div[3]/div[1]/div[1]/table/t 阅读全文
posted @ 2016-08-18 15:36 cpc_dingyi 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 今天在工作中遇到一个问题,table下有很多tr, tr下有很多td, td下有的有div,有的没有,但是每个tr下的文本得拿出来放在一块,然后我使用 l = doc.xpath('/html/body/div[3]/div[1]/div[1]/table')[0] 我的想法是将table下所有的标 阅读全文
posted @ 2016-08-18 15:13 cpc_dingyi 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 刚写代码报错:AttributeError: 'unicode' object has no attribute 'xpath' 场景是这样的: 然后运行就报错:AttributeError: 'unicode' object has no attribute 'xpath' 开始上网找了很多解决办 阅读全文
posted @ 2016-08-18 15:08 cpc_dingyi 阅读(10329) 评论(0) 推荐(1) 编辑