37

利用Python搜索51CTO推荐博客并保存至Excel-KaliArch-51CTO博客

 6 years ago
source link: http://blog.51cto.com/kaliarch/2067103
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、背景近期在学习爬虫,利用Requests模块获取页面,BeautifulSoup来获取需要的内容,最后利用xlsxwriter模块讲内容保存至excel,在此记录一下,后续可举一反三,利用其抓取其他内容持久和存储到文件内,或数据库等。二、代码编写了两个模块,geturl3和getexcel3,最后在main内调用geturl3.py代码内容如下:#!/bin/envpython#-*-codi

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK