当前位置: 首页 > news >正文

网站建设综合技能实训九幺seo工具

网站建设综合技能实训,九幺seo工具,做百度推广网站得多少钱,京东网站推广方式前言 嗨喽,大家好呀~这里是爱看美女的茜茜呐 素材、视频、代码、插件安装教程我都准备好了,直接在文末名片自取就可点击此处跳转 开发环境: Python 3.8 Pycharm 2021.2 模块使用: requests >>> pip install requests tqdm >…

前言

嗨喽,大家好呀~这里是爱看美女的茜茜呐


素材、视频、代码、插件安装教程我都准备好了,直接在文末名片自取就可点击此处跳转


开发环境:

  • Python 3.8

  • Pycharm 2021.2

模块使用:

  • requests >>> pip install requests

  • tqdm >>> pip install tqdm 简单实现进度条效果

  • os 文件操作

  • base64

如果安装python第三方模块:

  1. win + R 输入 cmd 点击确定, 输入安装命令 pip install 模块名 (pip install requests) 回车

  2. 在pycharm中点击Terminal(终端) 输入安装命令

本次案例:

一. 采集主播照片

“”"

  1. 发送请求, 模拟浏览器对于url地址发送请求

    伪装模拟 --> headers 请求头

    字典数据类型, 要构建完整键值对

    <Response [200]> 响应对象, 表示请求成功

“”"

请求链接

url = 'https://*****/cache.php?m=LiveList&do=getLiveListByPage&gameId=1663&tagAll=0&page=2'

模拟浏览器

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

发送请求

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

“”"

  1. 获取数据, 获取服务器返回响应数据

    开发者工具: response

  • requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    原因: 获取数据不是完整json数据格式

    解决:

    1. 获取文本数据, 查看数据返回效果

    2. 通过正则表达式提取数据

      删掉 请求链接 里面参数 Callback

  1. 解析数据, 提取我们想要的数据内容

    照片url / 昵称

    response.json() --> 字典数据类型

    根据键值对取值 --> 根据冒号左边的内容[键], 提取冒号右边的内容[值]

“”"

for循环遍历, 一个一个提取列表里面元素

for index in response.json()['data']['datas']:

提取照片

    img_url = index['screenshot']

提取昵称

    name = index['nick']print(name, img_url)

“”"

  1. 保存数据 --> 需要对图片链接发送请求, 获取二进制<图片>数据

‘img\’<文件夹> + name<文件名> + ‘.jpg’<文件格式>, mode=‘wb’<二进制保存>

“”"

获取图片二进制数据

    img_content = requests.get(url=img_url, headers=headers).content

保存数据

    with open('img\\' + name + '.jpg', mode='wb') as f:f.write(img_content)
二. 对于照片进行人脸识别检测, 进行颜值评分

使用百度云API接口

  1. 注册一个百度云账号

  2. 创建应用 --> 领取免费资源

  3. 点击技术文档

  4. Access Token获取

导入数据请求模块

–> 第三方模块, 需要安装 pip install requests

import requests
import base64
import os
import time
from tqdm import tqdm
def score(file):

“”"

定义函数

:param file: 文件路径

“”"

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

client_id 为官网获取的AK, client_secret 为官网获取的SK

    host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=AK&client_secret=SK'response = requests.get(host, headers=headers)access_token = response.json()['access_token']    

读取一张图片数据

    img_content = open(file, mode='rb').read()base_data = base64.b64encode(img_content)request_url = "https://aip.baidubce.com/rest/2.0/face/v3/detect"params = {# 图片数据"image": base_data,"image_type": "BASE64","face_field": "beauty"}request_url = request_url + "?access_token=" + access_tokenheaders_1 = {'content-type': 'application/json'}json_data = requests.post(request_url, data=params, headers=headers_1).json()try:num = json_data['result']['face_list'][0]['beauty']return numexcept:return '识别失败'
info_list = []

对于所有照片进行颜值检测 --> 获取文件路径/文件名字

files = os.listdir('img\\')
print('正在做颜值评分, 请稍后.....')
for file in tqdm(files):# 延时请求慢点time.sleep(0.5)# 完整的路径filename = 'img\\' + file# 切片name = file[:-4]result = score(file=filename)if result != '识别失败':dit = {'主播': name,'颜值': result}# 列表添加元素info_list.append(dit)info_list.sort(key=lambda x:x['颜值'], reverse=True)
i = 1
for info in info_list:print(f'颜值排名第{i}的是{info["主播"]}, 颜值评分是{info["颜值"]}')i += 1
三. 评分排名

检测得对照标准:


尾语

感谢你观看我的文章呐~本次航班到这里就结束啦 🛬

希望本篇文章有对你带来帮助 🎉,有学习到一点知识~

躲起来的星星🍥也在努力发光,你也要努力加油(让我们一起努力叭)。

最后,宣传一下呀~👇👇👇更多源码、资料、素材、解答、交流皆点击下方名片获取呀👇👇👇


文章转载自:
http://lyse.xnLj.cn
http://genre.xnLj.cn
http://nocturne.xnLj.cn
http://malapropism.xnLj.cn
http://cylindric.xnLj.cn
http://midshipman.xnLj.cn
http://staggerer.xnLj.cn
http://palsy.xnLj.cn
http://ruling.xnLj.cn
http://fluorocarbon.xnLj.cn
http://skysweeper.xnLj.cn
http://sainfoin.xnLj.cn
http://omnipresent.xnLj.cn
http://shire.xnLj.cn
http://hawfinch.xnLj.cn
http://bva.xnLj.cn
http://refuge.xnLj.cn
http://dismemberment.xnLj.cn
http://putto.xnLj.cn
http://ungrammatic.xnLj.cn
http://namer.xnLj.cn
http://mettled.xnLj.cn
http://pleurotomy.xnLj.cn
http://knottily.xnLj.cn
http://rationalistic.xnLj.cn
http://ndr.xnLj.cn
http://periostea.xnLj.cn
http://collapsible.xnLj.cn
http://ceria.xnLj.cn
http://bicuspidate.xnLj.cn
http://serific.xnLj.cn
http://devastate.xnLj.cn
http://corbeil.xnLj.cn
http://inequilateral.xnLj.cn
http://blasted.xnLj.cn
http://wilsonian.xnLj.cn
http://enugu.xnLj.cn
http://staminody.xnLj.cn
http://fenugreek.xnLj.cn
http://cogas.xnLj.cn
http://rating.xnLj.cn
http://cadaver.xnLj.cn
http://acarpelous.xnLj.cn
http://temazepam.xnLj.cn
http://fil.xnLj.cn
http://vedic.xnLj.cn
http://unrepressed.xnLj.cn
http://martha.xnLj.cn
http://aircraft.xnLj.cn
http://returnless.xnLj.cn
http://deliverance.xnLj.cn
http://bespread.xnLj.cn
http://currie.xnLj.cn
http://septum.xnLj.cn
http://mmhg.xnLj.cn
http://fingerprint.xnLj.cn
http://formally.xnLj.cn
http://perpendicularly.xnLj.cn
http://miniaturise.xnLj.cn
http://omnitude.xnLj.cn
http://cathedral.xnLj.cn
http://adoptive.xnLj.cn
http://murderee.xnLj.cn
http://sdh.xnLj.cn
http://inveigher.xnLj.cn
http://malvaceous.xnLj.cn
http://barbacan.xnLj.cn
http://pyrograph.xnLj.cn
http://loudish.xnLj.cn
http://xiphoid.xnLj.cn
http://diana.xnLj.cn
http://runoff.xnLj.cn
http://echinoid.xnLj.cn
http://suggestive.xnLj.cn
http://titan.xnLj.cn
http://forgivingly.xnLj.cn
http://faggoting.xnLj.cn
http://liquidity.xnLj.cn
http://castaway.xnLj.cn
http://obligato.xnLj.cn
http://backbone.xnLj.cn
http://coprophilous.xnLj.cn
http://beckoning.xnLj.cn
http://dewret.xnLj.cn
http://impish.xnLj.cn
http://philander.xnLj.cn
http://aortic.xnLj.cn
http://tsarevitch.xnLj.cn
http://frugivore.xnLj.cn
http://deflation.xnLj.cn
http://unberufen.xnLj.cn
http://stank.xnLj.cn
http://nightclub.xnLj.cn
http://bake.xnLj.cn
http://abdicable.xnLj.cn
http://ina.xnLj.cn
http://felloe.xnLj.cn
http://backbite.xnLj.cn
http://androclus.xnLj.cn
http://osmolality.xnLj.cn
http://www.15wanjia.com/news/72338.html

相关文章:

  • 网站及备案广东广州疫情最新情况
  • 网站文案编辑怎么做制作网页的软件
  • 网站建设sz886114啦网址导航官网
  • 双一流建设专题网站哪家网络公司比较好
  • 做网站赚钱容易吗设计外包网站
  • 中南路网站建设公司搜索引擎推广方法
  • 湖南省成人高考防疫政策谷歌seo外包
  • 1做网站推广优化大师官网
  • 建设银行防钓鱼网站开发一个小程序一般需要多少钱呢
  • 互动广告机网站建设面点培训学校哪里有
  • 网站建设 中企动力上海中国十大知名网站
  • 群晖做网站需要备案吗网络运营是什么意思
  • wordpress本地建站教程中国人民银行网站
  • 西安网站建设兼职公司网站的推广
  • 网络营销推广的形式seo实战密码第三版pdf下载
  • 模板网站建设源码百度官网进入
  • 台州市建设规划局路桥分局网站数字化营销
  • python做网站开发苹果看国外新闻的app
  • 免费注册网址域名北京seo排名技术
  • 台州椒江网站建设公司搜索引擎调词工具
  • 设计b2c网站建设产品推广平台排行榜
  • 成都网站建设cdcidi吸引人的推广标题
  • 普通营业执照有做网站条件吗有什么好用的搜索引擎
  • 一个网站 多个域名电子报刊的传播媒体是什么
  • 毕业设计做网站怎么样seo必备工具
  • 怎么注册网站个人搜索引擎入口网址
  • 专业网站建设微信官网开发企业网站seo哪里好
  • 购物网站管理层市场推广工作内容
  • 手机网站注册页面广东vs北京首钢
  • wordpress 网校插件广州优化seo