自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 Python学习笔记(三):常用内置函数学习

一.如何查看Python3的所有内置函数命令:dir(__builtins__)效果如下:dir(__builtins__)['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError',

2017-09-15 11:27:28 3480

原创 Python学习笔记(二):tuple属性及方法浅析

元组是存放任意元素集合,不能修改其内容.简单创建元组In [1]: T = () #创建一个空的元组In [2]: TOut[2]: ()In [3]: T = tuple() #创建一个空的元组In [4]: TOut[4]: ()In [8]: T = (1,) #创建包含一个对象的元组,不能写成T = (1),这会被解释成T =

2017-09-14 17:41:45 4956

原创 Python学习笔记(一):list属性及方法浅析

列表学习。List是python中的基本数据结构之一。创建一个列表的方法L = [1,2,3,'a']通过help(list)查看列表的属性及方法。>>> help(list)Help on class list in module builtins:class list(object) |  list() -> new empty list |

2017-09-14 12:27:04 9298

原创 Ptyhon爬虫实战(七):爬取汽车公告网上的批次排量等信息

网址:http://www.cn357.com/notice/直接上代码。#coding=utf-8import reimport requestsdef getHtml(url): try: page = requests.get(url) html = page.text return html

2017-09-08 12:48:43 30422 1

原创 Python爬虫实战(六):爬取糗事百科段子

直接上代码:#coding=utf-8 import requestsimport urllib.request from bs4 import BeautifulSoupdef getHtml(url): page = requests.get(url) html =page.text return htmldef getImg(h

2017-09-05 12:33:56 34776 1

原创 Python爬虫实战(五) :下载百度贴吧帖子里的所有图片

准备工作:目标网址:https://tieba.baidu.com/p/5113603072目的:    下载该页面上的所有楼层里的照片第一步:分析网页源码火狐浏览器  ---> 在该页面上右击 “查看页面源代码”,会打开一个新的标签页。第二步:查找图片源地址在新标签页上ctrl + F,输入jpg,找到第一个图片的源地址BTW,怎么知道这个链接是不是第

2017-09-05 12:31:16 49511 2

原创 Python爬虫实战(四) :下载煎蛋网所有妹子照片

煎蛋网是一个适合开车的网站,各种妹子福利图片。网站:http://jandan.net/ooxx里面有两种格式的图片:gif和jpg,写个程序将所有页面的妹子图全部下载下来。#coding=utf-8import requestsimport urllib.requestfrom bs4 import BeautifulSoupdef getHtml(url):

2017-09-04 22:03:47 17379 1

原创 Python爬虫实战(三):简单爬取网页图片

先上代码:#coding=utf-8import urllib.requestfor i in range(1,41): imgurl = "http://mtl.ttsqgs.com/images/img/11552/" imgurl += str(i) + ".jpg" urllib.request.urlretrieve(imgurl,'%s.jpg' % i

2017-09-04 13:00:00 5170

原创 Python爬虫实战(二):爬取天涯帖子(只看楼主)

先上代码#coding=utf-8import requestsfrom bs4 import BeautifulSoupdef getHtml(url): page = requests.get(url) html =page.text return htmldef getText(html): global i listautho

2017-09-04 12:52:11 34440

原创 Python爬虫实战(一):爬取豆瓣电影top250排名

先上代码#coding=utf-8import reimport urllib.requestdef getHtml(url): page = urllib.request.urlopen(url) html = page.read() html = html.decode('utf-8') return htmldef getItem(ht

2017-09-04 12:34:18 5723

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除