爬虫
tmaczt
一个热爱生活的程序员
展开
-
Python BeautifulSoup(bs4)采集新闻
python使用BeautifulSoup采集新浪新闻 from bs4 import BeautifulSoup import requests url="http://roll.finance.sina.com.cn/finance/zq1/ssgs/index.shtml" res=requests.get(url) res.encoding='gb2312' soup=Beautiful...原创 2018-09-13 11:18:45 · 316 阅读 · 0 评论 -
Python lxml + XPath采集网站数据
lxml是python的一个解析库,支持HTML、XML、XPath等解析方式,官方地址:https://lxml.de/ XPath教程:http://www.w3school.com.cn/xpath/index.asp import urllib import lxml.etree class csdn_blog(): def __init__(self): sel...原创 2019-01-14 11:28:20 · 535 阅读 · 0 评论