python简单网络爬虫
一个简单的网络爬虫
# -*- coding: UTF-8 -*- import requests from lxml import etree import json def spider(url): html = requests.get(url) select = etree.HTML(html.text) content = select.xpath("/html/body/div[1]/div[2]/div[1]/div/div[1]/div/div/div[2]/div[1]/p[2]/strong") for e in content: print e.text if __name__=='__main__': spider("http://www.cnblogs.com/wangyayun/p/6557851.html")
相关推荐
CycloneKid 2020-10-27
jling 2020-09-17
fengling 2020-08-15
我欲疾风前行 2020-06-18
我欲疾风前行 2020-06-04
athrenzala 2020-05-30
zengni 2020-05-29
sunzhihaofuture 2020-05-17
hilary0 2020-05-15
hilary0 2020-05-04
hilary0 2020-05-03
fangjack 2020-04-22
knightwatch 2020-04-16
宿舍 2020-03-06
四叶草 2020-02-15
oXiaoChong 2020-02-14
四叶草 2020-01-30