soarli

百度PY-Day2理论课课堂笔记
课件:点击下载Python数据结构类型:数字、字符串、列表、元组、字典数字Python Number 数据类型用...
扫描右侧二维码阅读全文
23
2020/04

百度PY-Day2理论课课堂笔记

课件:点击下载

Python数据结构

类型:

数字、字符串、列表、元组、字典

数字

Python Number 数据类型用于存储数值。

Python Number 数据类型用于存储数值,包括整型、长整型、浮点型、复数。

(1)Python math 模块:

Python 中数学运算常用的函数基本都在 math 模块

import math

print(math.ceil(4.1))   #返回数字的上入整数

print(math.floor(4.9))  #返回数字的下舍整数

print(math.fabs(-10))   #返回数字的绝对值

print(math.sqrt(9))     #返回数字的平方根

print(math.exp(1))      #返回e的x次幂

(2)Python随机数

首先import random,使用random()方法即可随机生成一个[0,1)范围内的实数

import random
ran = random.random()
print(ran)

调用 random.random() 生成随机数时,每一次生成的数都是随机的。但是,当预先使用 random.seed(x) 设定好种子之后,其中的 x 可以是任意数字,此时使用 random() 生成的随机数将会是同一个。

print ("------- 设置种子 seed -------")
random.seed(10)
print ("Random number with seed 10 : ", random.random())

# 生成同一个随机数
random.seed(10)
print ("Random number with seed 10 : ", random.random())

randint()生成一个随机整数

ran = random.randint(1,20)
print(ran)

字符串

字符串连接:+

a = "Hello "
b = "World "
print(a + b)

重复输出字符串:*

print(a * 3)

通过索引获取字符串中字符[]

print(a[0])

字符串截取[:] 牢记:左开右闭

print(a[1:4])

判断字符串中是否包含给定的字符: in, not in

print('e' in a)
print('e' not in a)

join():以字符作为分隔符,将字符串中所有的元素合并为一个新的字符串

new_str = '-'.join('Hello')
print(new_str)

字符串单引号、双引号、三引号

print('Hello World!')
print("Hello World!")

转义字符 \

print("The \t is a tab")
print('I\'m going to the movies')

三引号让程序员从引号和特殊字符串的泥潭里面解脱出来,自始至终保持一小块字符串的格式是所谓的WYSIWYG所见即所得)格式的。

print('''I'm going to the movies''')

html = '''
<HTML><HEAD><TITLE>
Friends CGI Demo</TITLE></HEAD>
<BODY><H3>ERROR</H3>
<B>%s</B><P>
<FORM><INPUT TYPE=button VALUE=Back
ONCLICK="window.history.back()"></FORM>
</BODY></HTML>
'''
print(html)

列表

作用:类似其他语言中的数组

声明一个列表,并通过下标或索引获取元素

#声明一个列表
names = ['jack','tom','tonney','superman','jay']

#通过下标或索引获取元素
print(names[0])
print(names[1])
#获取最后一个元素
print(names[-1])
print(names[len(names)-1])
#获取第一个元素
print(names[-5])
#遍历列表,获取元素
for name in names:
    print(name)
#查询names里面有没有superman
for name in names:
    if name == 'superman':
        print('有超人')
        break
else:
    print('有超人')
#更简单的方法,来查询names里有没有superman
if 'superman' in names:
    print('有超人')
else:
    print('有超人')

列表元素添加

#声明一个空列表
girls = []

#append(),末尾追加
girls.append('杨超越')
print(girls)
#extend(),一次添加多个。把一个列表添加到另一个列表 ,列表合并。
models = ['刘雯','奚梦瑶']
girls.extend(models)
#girls = girls + models
print(girls)
#insert():指定位置添加
girls.insert(1,'虞书欣')
print(girls)

列表元素修改,通过下标找到元素,然后用=赋值

fruits = ['apple','pear','香蕉','pineapple','草莓']
print(fruits)

fruits[-1] = 'strawberry'
print(fruits)
'''
将fruits列表中的‘香蕉’替换为‘banana’
'''

for fruit in fruits:
    if '香蕉' in fruit:
        fruit = 'banana'
print(fruits)

for i in range(len(fruits)):
    if '香蕉' in fruits[i]:
        fruits[i] = 'banana'
        break
print(fruits)

列表元素删除

words = ['cat','hello','pen','pencil','ruler']
del words[1]
print(words)
words = ['cat','hello','pen','pencil','ruler']
words.remove('cat')
print(words)
words = ['cat','hello','pen','pencil','ruler']
words.pop(1)
print(words)

列表切片

  • Python中处理列表的部分元素,称之为切片。
  • 创建切片,可指定要使用的第一个元素和最后一个元素的索引。注意:左开右闭
  • 将截取的结果再次存放在一个列表中,所以还是返回列表

animals = ['cat','dog','tiger','snake','mouse','bird']

print(animals[2:5])

print(animals[-1:])

print(animals[-3:-1])

print(animals[-5:-1:2])

print(animals[::2])



列表排序

  • 随机生成10个不同的整数,并进行排序
'''
生成10个不同的随机整数,并存至列表中
'''
import  random

random_list = []
for i in range(10):
    ran = random.randint(1,20)
    if ran not in  random_list:
        random_list.append(ran)
print(random_list)

上述代码存在什么问题吗?

import  random

random_list = []
i = 0
while i < 10:
    ran = random.randint(1,20)
    if ran not in  random_list:
        random_list.append(ran)
        i+=1
print(random_list)
#默认升序
new_list = sorted(random_list)
print(new_list)

#降序
new_list = sorted(random_list,reverse =True)
print(new_list)

元组

与列表类似,元祖中的内容不可修改

tuple1 = ()
print(type(tuple1))
tuple2 = ('hello')
print(type(tuple2))

注意:元组中只有一个元素时,需要在后面加逗号!

tuple3 = ('hello',)
print(type(tuple3))

元组不能修改,所以不存在往元组里加入元素。

那作为容器的元组,如何存放元素?

import random

random_list = []
for i in range(10):
    ran = random.randint(1,20)
    random_list.append(ran)
print(random_list)

random_tuple = tuple(random_list)
print(random_tuple)

元组访问

print(random_tuple)
print(random_tuple[0])
print(random_tuple[-1])
print(random_tuple[1:-3])
print(random_tuple[::-1])

元组的修改:

t1 = (1,2,3)+(4,5)
print(t1)
t2 = (1,2) * 2
print(t2)

元组的一些函数:

print(max(random_tuple))
print(min(random_tuple))
print(sum(random_tuple))
print(len(random_tuple))
#统计元组中4的个数
print(random_tuple.count(4))
#元组中4所对应的下标,如果不存在,则会报错
print(random_tuple.index(4))
#判断元组中是否存在1这个元素
print(4 in random_tuple)

#返回元组中4所对应的下标,不会报错
if(4 in random_tuple):
    print(random_tuple.index(4))

元组的拆包与装包

#定义一个元组
t3 = (1,2,3)

#将元组赋值给变量a,b,c
a,b,c = t3

#打印a,b,c
print(a,b,c)
#当元组中元素个数与变量个数不一致时

#定义一个元组,包含5个元素
t4 = (1,2,3,4,5)

#将t4[0],t4[1]分别赋值给a,b;其余的元素装包后赋值给c
a,b,*c = t4

print(a,b,c)
print(c)
print(*c)

字典

#定义一个空字典

dict1 = {}

dict2 = {'name':'杨超越','weight':45,'age':25}
print(dict2['name'])
#list可以转成字典,但前提是列表中元素都要成对出现
dict3 = dict([('name','杨超越'),('weight',45)])
print(dict3)
dict4 = {}
dict4['name'] = '虞书欣'
dict4['weight'] = 43
print(dict4)
dict4['weight'] = 44
print(dict4)
#字典里的函数 items()  keys() values()

dict5 = {'杨超越':165,'虞书欣':166,'上官喜爱':164}
print(dict5.items())
for key,value in dict5.items():
    if value > 165:
        print(key)
#values() 取出字典中所有的值,保存到列表中

results = dict5.values()
print(results)
#求小姐姐的平均身高
heights = dict5.values()
print(heights)
total = sum(heights)
avg = total/len(heights)
print(avg)
names = dict5.keys()
print(names)
#print(dict5['赵小棠'])       

print(dict5.get('赵小棠'))

print(dict5.get('赵小棠',170)) #如果能够取到值,则返回字典中的值,否则返回默认值170
dict6 = {'杨超越':165,'虞书欣':166,'上官喜爱':164}
del dict6['杨超越']
print(dict6)
result = dict6.pop('虞书欣')
print(result)
print(dict6)

Python面向对象

定义一个类Animals:

(1)init()定义构造函数,与其他面向对象语言不同的是,Python语言中,会明确地把代表自身实例的self作为第一个参数传入

(2)创建一个实例化对象 catinit()方法接收参数

(3)使用点号 . 来访问对象的属性。

class Animal:

    def __init__(self,name):
        self.name = name
        print('动物名称实例化')
    def eat(self):
        print(self.name +'要吃东西啦!')
    def drink(self):
        print(self.name +'要喝水啦!')

cat =  Animal('miaomiao')
print(cat.name)
cat.eat()
cat.drink()
class Person:        
    def __init__(self,name):
        self.name = name
        print ('调用父类构造函数')

    def eat(self):
        print('调用父类方法')
 
class Student(Person):  # 定义子类
   def __init__(self):
      print ('调用子类构造方法')
 
   def study(self):
      print('调用子类方法')

s = Student()          # 实例化子类
s.study()              # 调用子类的方法
s.eat()                # 调用父类方法

Python JSON

JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,易于人阅读和编写。

json.dumps 用于将 Python 对象编码成 JSON 字符串。

import json
data = [ { 'b' : 2, 'd' : 4, 'a' : 1, 'c' : 3, 'e' : 5 } ]
json = json.dumps(data)
print(json)

为了提高可读性,dumps方法提供了一些可选的参数。

sort_keys=True表示按照字典排序(a到z)输出。

indent参数,代表缩进的位数

separators参数的作用是去掉,和:后面的空格,传输过程中数据越精简越好

import json
data = [ { 'b' : 2, 'd' : 4, 'a' : 1, 'c' : 3, 'e' : 5 } ]
json = json.dumps(data, sort_keys=True, indent=4,separators=(',', ':'))
print(json)

json.loads 用于解码 JSON 数据。该函数返回 Python 字段的数据类型。

import json
jsonData = '{"a":1,"b":2,"c":3,"d":4,"e":5}'
text = json.loads(jsonData)  #将string转换为dict
print(text)

Python异常处理

Python脚本发生异常时我们需要捕获处理它,否则程序会终止执行。

捕捉异常可以使用try/except语句。

try/except语句用来检测try语句块中的错误,从而让except语句捕获异常信息并处理。

try:
    fh = open("/home/aistudio/data/testfile01.txt", "w")
    fh.write("这是一个测试文件,用于测试异常!!")
except IOError:
    print('Error: 没有找到文件或读取文件失败')
else:
    print ('内容写入文件成功')
    fh.close()

finally中的内容,退出try时总会执行

try:
    f = open("/home/aistudio/data/testfile02.txt", "w")
    f.write("这是一个测试文件,用于测试异常!!")
finally:
    print('关闭文件')
    f.close()

常见Linux命令

!ls /home
!ls ./
ls  -l
!pwd

cp :复制文件或目录

!cp test.txt ./test_copy.txt

mv:移动文件与目录,或修改文件与目录的名称

!mv /home/aistudio/work/test_copy.txt /home/aistudio/data/

rm :移除文件或目录

!rm /home/aistudio/data/test_copy.txt

很多大型文件或者数据从服务器上传或者下载的时候都需要打包和压缩解压,这时候知道压缩和解压的各种命令是很有必要的。

常见的压缩文件后缀名有.tar.gz.gz,和.zip,下面来看看在Linux上它们分别的解压和压缩命令。

gzip:

linux压缩文件中最常见的后缀名即为.gzgzip是用来压缩和解压.gz文件的命令。

常用参数:

-d或--decompress或--uncompress:解压文件;
-r或--recursive:递归压缩指定文件夹下的文件(该文件夹下的所有文件被压缩成单独的.gz文件);
-v或--verbose:显示指令执行过程。
注:gzip命令只能压缩单个文件,而不能把一个文件夹压缩成一个文件(与打包命令的区别)。
#会将文件压缩为文件 test.txt.gz,原来的文件则没有了,解压缩也一样
!gzip /home/aistudio/work/test.txt
!gzip -d /home/aistudio/test.gz

tar:

tar本身是一个打包命令,用来打包或者解包后缀名为.tar。配合参数可同时实现打包和压缩。

常用参数:

-c或--create:建立新的备份文件;
-x或--extract或--get:从备份文件中还原文件;
-v:显示指令执行过程;
-f或--file:指定备份文件;
-C:指定目的目录;
-z:通过gzip指令处理备份文件;
-j:通过bzip2指令处理备份文件。

最常用的是将tar命令与gzip命令组合起来,直接对文件夹先打包后压缩:

!tar -zcvf /home/aistudio/work/test.tar.gz /home/aistudio/work/test.txt
!tar -zxvf /home/aistudio/work/test.tar.gz

zip和unzip

zip命令和unzip命令用在在Linux上处理.zip的压缩文件。

常用参数

-v:显示指令执行过程;
-m:不保留原文件;
-r:递归处理。
-v:显示指令执行过程;
-d:解压到指定目录。
!zip -r /home/aistudio/work/test.zip /home/aistudio/work/test.txt
!unzip  /home/aistudio/work/test.zip 

作业:

深度学习实践平台与Python进阶

  • Day2-《青春有你2》选手信息爬取

爬虫的过程,就是模仿浏览器的行为,往目标站点发送请求,接收服务器的响应数据,提取需要的信息,并进行保存的过程。

Python为爬虫的实现提供了工具:requests模块、BeautifulSoup

下面先简单介绍一下两个模块:

一、requests

Requests 允许你发送纯天然,植物饲养的 HTTP/1.1 请求,无需手工劳动。你不需要手动为 URL 添加查询字串,也不需要对 POST 数据进行表单编码。Keep-alive 和 HTTP 连接池的功能是 100% 自动化的,一切动力都来自于根植在 Requests 内部的urllib3

pip命令安装

  • windows系统下只需要在命令行输入命令 pip install requests 即可安装
  • linux 系统下,只需要输入命令 sudo pip install requests ,即可安装。

requests库的七个主要方法

  1. requests.request()构造一个请求,支持以下各种方法
  2. requests.get()获取html的主要方法
  3. requests.head()获取html头部信息的主要方法
  4. requests.post()html网页提交post请求的方法
  5. requests.put()html网页提交put请求的方法
  6. requests.patch()html提交局部修改的请求
  7. requests.delete()html提交删除请求
import requests

response = requests.get('http://www.baidu.com')
print(response.status_code)  # 打印状态码
print(response.url)          # 打印请求url
print(response.headers)      # 打印头信息
print(response.cookies)      # 打印cookie信息
print(response.text)  #以文本形式打印网页源码
print(response.content) #以字节流形式打印

二、BeautifulSoup

Beautiful Soup 是一个可以从 HTMLXML 文件中提取数据的 Python 库.它能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文档的方式.Beautiful Soup 会帮你节省数小时甚至数天的工作时间.

pip install beautifulsoup4

BeautifulSoup不仅支持HTML解析器,还支持一些第三方的解析器,如,lxml,XML,html5lib但是需要安装相应的库。

pip install lxml

pip install html5lib

简单用法

将一段文档传入 BeautifulSoup 的构造方法,就能得到一个文档的对象, 可以传入一段字符串或一个文件句柄.

首先传入一个 html 文档,soup 是获得文档的对象。然后,文档被转换成 Unicode ,并且 HTML 的实例都被转换成 Unicode 编码。然后,Beautiful Soup 选择最合适的解析器来解析这段文档,如果手动指定解析器那么 Beautiful Soup 会选择指定的解析器来解析文档。但是一般最好手动指定解析器,并且使用 requestsBeautifulSoup 结合使用, requests 是用于爬取网页源码的一个库,此处不再介绍,requests 更多用法请参考 Requests 2.10.0 文档 。要解析的文档是什么类型: 目前支持, html, xml,html5

  • 指定使用哪种解析器: 目前支持, lxml, html5lib,html.parser

BeautifulSoup中的find和findall

1.一般来说,为了找到BeautifulSoup对象内任何第一个标签入口,使用find()方法。!!!作业说明!!!

2.find()查找第一个匹配结果出现的地方,find_all()找到所有匹配结果出现的地方。

任务描述

本次实践使用Python来爬取百度百科中《青春有你2》所有参赛选手的信息。

数据获取:https://baike.baidu.com/item/青春有你第二季

上网的全过程:

普通用户:

打开浏览器 --> 往目标站点发送请求 --> 接收响应数据 --> 渲染到页面上。

爬虫程序:

模拟浏览器 --> 往目标站点发送请求 --> 接收响应数据 --> 提取有用的数据 --> 保存到本地/数据库。

爬虫的过程

1.发送请求(requests模块)

2.获取响应数据(服务器返回)

3.解析并提取数据(BeautifulSoup查找或者re正则)

4.保存数据

本实践中将会使用以下两个模块,首先对这两个模块简单了解以下:

request模块:

requests是python实现的简单易用的HTTP库,官网地址:http://cn.python-requests.org/zh_CN/latest/

requests.get(url)可以发送一个http get请求,返回服务器响应内容。

BeautifulSoup库:

BeautifulSoup 是一个可以从HTML或XML文件中提取数据的Python库。网址:https://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/

BeautifulSoup支持Python标准库中的HTML解析器,还支持一些第三方的解析器,其中一个是 lxml。

BeautifulSoup(markup, "html.parser")或者BeautifulSoup(markup, "lxml"),推荐使用lxml作为解析器,因为效率更高。
#如果需要进行持久化安装, 需要使用持久化路径, 如下方代码示例:
#!mkdir /home/aistudio/external-libraries
#!pip install beautifulsoup4 -t /home/aistudio/external-libraries
#!pip install lxml -t /home/aistudio/external-libraries
# 同时添加如下代码, 这样每次环境(kernel)启动的时候只要运行下方代码即可:
import sys
sys.path.append('/home/aistudio/external-libraries')

一、爬取百度百科中《青春有你2》中所有参赛选手信息,返回页面数据

import json
import re
import requests
import datetime
from bs4 import BeautifulSoup
import os

#获取当天的日期,并进行格式化,用于后面文件命名,格式:20200420
today = datetime.date.today().strftime('%Y%m%d')    

def crawl_wiki_data():
    """
    爬取百度百科中《青春有你2》中参赛选手信息,返回html
    """
    headers = { 
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
    }
    url='https://baike.baidu.com/item/青春有你第二季'                         

    try:
        response = requests.get(url,headers=headers)

        print(response.status_code)

        #将一段文档传入BeautifulSoup的构造方法,就能得到一个文档的对象, 可以传入一段字符串
        soup = BeautifulSoup(response.text,'lxml')

        #返回的是class为table-view log-set-param的<table>所有标签
        tables = soup.find_all('table',{'class':'table-view log-set-param'})

        crawl_table_title = "参赛学员"

        for table in  tables:           
            #对当前节点前面的标签和字符串进行查找
            table_titles = table.find_previous('div').find_all('h3')
            for title in table_titles:
                if(crawl_table_title in title):
                    return table       
    except Exception as e:
        print(e)

二、对爬取的页面数据进行解析,并保存为JSON文件

def parse_wiki_data(table_html):
    '''
    从百度百科返回的html中解析得到选手信息,以当前日期作为文件名,存JSON文件,保存到work目录下
    '''
    bs = BeautifulSoup(str(table_html),'lxml')
    all_trs = bs.find_all('tr')

    error_list = ['\'','\"']

    stars = []

    for tr in all_trs[1:]:
         all_tds = tr.find_all('td')

         star = {}

         #姓名
         star["name"]=all_tds[0].text
         #个人百度百科链接
         star["link"]= 'https://baike.baidu.com' + all_tds[0].find('a').get('href')
         #籍贯
         star["zone"]=all_tds[1].text
         #星座
         star["constellation"]=all_tds[2].text
         #身高
         star["height"]=all_tds[3].text
         #体重
         star["weight"]= all_tds[4].text

         #花语,去除掉花语中的单引号或双引号
         flower_word = all_tds[5].text
         for c in flower_word:
             if  c in error_list:
                 flower_word=flower_word.replace(c,'')
         star["flower_word"]=flower_word 

         #公司
         if not all_tds[6].find('a') is  None:
             star["company"]= all_tds[6].find('a').text
         else:
             star["company"]= all_tds[6].text  

         stars.append(star)

    json_data = json.loads(str(stars).replace("\'","\""))   
    with open('work/' + today + '.json', 'w', encoding='UTF-8') as f:
        json.dump(json_data, f, ensure_ascii=False)

三、爬取每个选手的百度百科图片,并进行保存

!!!请在以下代码块中补充代码,爬取每个选手的百度百科图片,并保存 !!!

def crawl_pic_urls():
    '''
    爬取每个选手的百度百科图片,并保存
    ''' 
    with open('work/'+ today + '.json', 'r', encoding='UTF-8') as file:
         json_array = json.loads(file.read())

    headers = { 
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' 
     }

    statistics_datas = []

    for star in json_array:

        name = star['name']
        link = star['link']

        #!!!请在以下完成对每个选手图片的爬取,将所有图片url存储在一个列表pic_urls中!!!

        #向选手个人百度百科发送一个http get请求
        response = requests.get(link,headers=headers)

        #将一段文档传入BeautifulSoup得构造方法,就能得到一个文档的对象
        bs = BeautifulSoup(response.text, 'lxml')

        #从个人百度百科页面中解析得到一个链接,该链接指向选手图片列表页面
        pic_list_url = bs.select('.summary-pic a')[0].get('href')
        pic_list_url = 'https://baike.baidu.com' + pic_list_url

        #向选手图片列表页面发送http get请求
        pic_list_response = requests.get(pic_list_url, headers = headers)

        #对选手图片列表页面进行解析,获取所有图片链接
        bs = BeautifulSoup(pic_list_response.text, 'lxml')
        pic_list_html = bs.select('.pic-item img')


        pic_urls =[]
        for pic_html in pic_list_html:
            pic_url = pic_html.get('src')
            pic_urls.append(pic_url)





        #!!!根据图片链接列表pic_urls, 下载所有图片,保存在以name命名的文件夹中!!!
        down_pic(name,pic_urls)
def down_pic(name,pic_urls):
    '''
    根据图片链接列表pic_urls, 下载所有图片,保存在以name命名的文件夹中,
    '''
    path = 'work/'+'pics/'+name+'/'

    if not os.path.exists(path):
      os.makedirs(path)

    for i, pic_url in enumerate(pic_urls):
        try:
            pic = requests.get(pic_url, timeout=15)
            string = str(i + 1) + '.jpg'
            with open(path+string, 'wb') as f:
                f.write(pic.content)
                print('成功下载第%s张图片: %s' % (str(i + 1), str(pic_url)))
        except Exception as e:
            print('下载第%s张图片时失败: %s' % (str(i + 1), str(pic_url)))
            print(e)
            continue

四、打印爬取的所有图片的路径

def show_pic_path(path):
    '''
    遍历所爬取的每张图片,并打印所有图片的绝对路径
    '''
    pic_num = 0
    for (dirpath,dirnames,filenames) in os.walk(path):
        for filename in filenames:
           pic_num += 1
           print("第%d张照片:%s" % (pic_num,os.path.join(dirpath,filename)))           
    print("共爬取《青春有你2》选手的%d照片" % pic_num)
if __name__ == '__main__':

     #爬取百度百科中《青春有你2》中参赛选手信息,返回html
     html = crawl_wiki_data()

     #解析html,得到选手信息,保存为json文件
     parse_wiki_data(html)

     #从每个选手的百度百科页面上爬取图片,并保存
     crawl_pic_urls()

     #打印所爬取的选手图片路径
     show_pic_path('/home/aistudio/work/pics/')

     print("所有信息爬取完成!")
200
成功下载第1张图片: https://bkimg.cdn.bcebos.com/pic/faf2b2119313b07eca80d4dd909f862397dda0442687?x-bce-process=image/resize,m_lfit,h_160,limit_1
成功下载第2张图片: https://bkimg.cdn.bcebos.com/pic/0eb30f2442a7d933f4894f2aa24bd11373f00141?x-bce-process=image/resize,m_lfit,w_268,limit_1
成功下载第1张图片: https://bkimg.cdn.bcebos.com/pic/0e2442a7d933c895d14398ba4d5b64f082025bafaa90?x-bce-process=image/resize,m_lfit,h_160,limit_1
..............
............
..........
...........
第482张照片:/home/aistudio/work/pics/查祎琛/1.jpg
共爬取《青春有你2》选手的482照片
所有信息爬取完成!

最后修改:2020 年 04 月 26 日 12 : 12 AM

发表评论