首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >python 爬取csdn我的个人信息

python 爬取csdn我的个人信息

作者头像
刘鸿运
发布于 2022-11-22 00:12:17
发布于 2022-11-22 00:12:17
28200
代码可运行
举报
文章被收录于专栏:奋斗少年奋斗少年
运行总次数:0
代码可运行
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import requests
from bs4 import BeautifulSoup
print("16岁IT职业刘鸿运所写")
'''免登csdn器-刘鸿运'''
csdn_headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"}
csdn_url=f"https://blog.csdn.net/qq_48983948?spm=1000.2115.3001.5343"
resu=requests.get(url=csdn_url,headers=csdn_headers)
csdn_x=BeautifulSoup(resu.text,'lxml')
print("*"*38,"我的基本信息","*"*38)
def csdn_name(info):
    print(f"CSDN用户名:{info[0].get_text()}")
csdn_name(info = csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-t > div > div:nth-child(1)"))
def csdn_passwrod_age(css):
    print(f"我的码龄:{css[0].get_text()}")
csdn_passwrod_age(css=csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-t > div > div.person-code-age > span"))
def csdn_password_age_img(img):
    print(f"码龄图片地址:{img}")
csdn_password_age_img(csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-t > div > div.person-code-age > img"))
def csdn_yuan_wen(number):
    print(f"我的原文章数量:{number[0].get_text()}")
csdn_yuan_wen(csdn_x.select('#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-c > ul > li:nth-child(2) > a > div.user-profile-statistics-num'))
def csdn_fensi(number):
    print(f"我的粉丝量:{number[0].get_text()}")
csdn_fensi(csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-c > ul > li:nth-child(4) > a > div.user-profile-statistics-num"))
def csdn_pai(number):
    print(f"当前csdn排名:{number[0].get_text()}")
csdn_pai(csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-t > div.user-profile-head-info-l > div.user-profile-head-info-rr > div.user-profile-head-info-r-c > ul > li:nth-child(3) > a > div.user-profile-statistics-num"))
def csdn_sd(num):
    print("我发布的文章")
    for i in num:
        print(i)
        s=len(i)
        print(f"一共{s}篇文章")
csdn_sd(num=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-right > div.navList-box > div.mainContent > div > div"))
print("*"*38,"我的基本信息","*"*38)
print("*"*38,"我的原力信息","*"*38)
def my_yuanli(number):
    print(f"我的原力等级:{number[0].get_text()}")
my_yuanli(csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-influence-list > ul > li > div.influence-top > div.influence-left > a > span"))
def my_yuanli_zong_fen(number):
    print(f"我的原力总分:{number}")
my_yuanli(number=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-influence-list > ul > li > div.influence-bottom > div > span.influence-count"))
def my_yuanli_yue_fen(number):
    print(f"当月原理总分:{number[0].get_text()}")
my_yuanli_yue_fen(number=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-influence-list > ul > li > div.influence-bottom > div > a > span.influence-count"))
print("*"*38,"我的原力信息","*"*38)
print("*"*38,"个人成就","*"*38)
def my_ge_ren_chengjiu_zan(num):
    print(f"当前活得总共:{num[0].get_text()}次赞")
my_ge_ren_chengjiu_zan(num=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-achievement.user-profile-aside-common-box > div.aside-common-box-bottom > div > ul > li:nth-child(1) > div > span"))
def my_ge_ren_chengjiu_pinglun(num):
    print(f"总共获得了:{num[0].get_text()}次评论")
my_ge_ren_chengjiu_pinglun(num=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-achievement.user-profile-aside-common-box > div.aside-common-box-bottom > div > ul > li:nth-child(2) > div > span"))
def my_ge_ren_chengjiu_shoucang(num):
    print(f"总共获得了:{num[0].get_text()}次收藏")
my_ge_ren_chengjiu_shoucang(num=csdn_x.select("#userSkin > div.user-profile-body > div > div.user-profile-body-left > div > div.user-achievement.user-profile-aside-common-box > div.aside-common-box-bottom > div > ul > li:nth-child(3) > div > span"))
print("*"*38,"个人成就","*"*38)
print("*"*38,"个人信息","*"*38)
def geren(names):
    print(f"{names[0].get_text()}")
geren(names=csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-b > p"))
def ip_phone(phone):
    print(f"IP归属地:{phone[0].get_text()}")
ip_phone(phone=csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-b > div.user-profile-head-address > span > span > span"))
def csdn_jiaru(times):
    print(f"加入csdn时间:{times[0].get_text()}")
csdn_jiaru(times=csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-b > div.user-profile-head-info-b-r > div > ul > li > span.user-general-info-key-word"))
def csdn_boke(names):
    print(f"博客简称:{names[0].get_text()}")
csdn_boke(names=csdn_x.select("#userSkin > div.user-profile-head > div.user-profile-head-info > div.user-profile-head-info-b > div.user-profile-head-info-b-r > div > div > div > h1"))
print("*"*38,"个人信息","*"*38)
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-11-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
python 爬取淘宝模特信息
  通过本篇博文,介绍一下我对指定信息进行爬取的时候的思路,顺便贴一下代码。  一、首先获取想要爬取的网站的url链接的规则变化 可以看出来该网站页面的url结构简单,变化的只是https://mm.
py3study
2020/01/07
6031
python 爬取淘宝模特信息
用Python制作酷炫的可视化大屏,特简单!
在数据时代,我们每个人既是数据的生产者,也是数据的使用者,然而初次获取和存储的原始数据杂乱无章、信息冗余、价值较低。
小F
2021/12/27
2.1K0
用Python制作酷炫的可视化大屏,特简单!
每日分享html特效篇1个侧边栏菜单+2个导航栏+1个登录页面+6个加载
1.前端工程师主要利用HMTL与CSS建构页面(其中html构建骨架,css构建样式),用JavaScript获取后端数据以及完善交互以及用户体验。 2.通俗来讲,前端在一个项目里,拿到UI设计师设计的设计稿,然后实现UI设计师设计稿,调用后端程序员给的数据接口以获取数据,然后测试,最后部署上线。 3.前端可以对设计图负责,大部分情况下,不需要特别的去理解业务逻辑,因为我们90后都是玩着十几年手机电脑长大的,十几年的经验足够我们在潜意识里想明白应该怎么做,怎么去一步步实现,会有什么意外情况。 4.我感觉前端发展有个很大的缺陷----晋升问题. 正如第三点所言,作为领导必须对项目有足够的了解,显然是要重点包括业务逻辑,这点上,后端开发者需要涉及数据库逻辑,是必须要跟业务逻辑打交道的(重中之重),因此,大部分的领导岗位都是后端开发者更有晋升的机会。当然,个别公司有专门的前端组长(这也不算什么),如果说前端开发者在自己工作范围之外还要腾出时间去研究业务逻辑,属实是觉得出力不讨好(因为这样的操作需要持续很久才能看出效果),而且再怎么研究业务逻辑也不会比每时每刻跟业务逻辑打交道的后端开发者了解更多。说实在的,大部分情况下,前端在配合后端进行开发.后端需要了解业务逻辑,要跟领导和客户商量细节,露脸机会很大,在老板面前刷脸次数众多。这些都是拉开前后端程序员晋升机会差距的因素。
淼学派对
2022/11/20
3.6K0
每日分享html特效篇1个侧边栏菜单+2个导航栏+1个登录页面+6个加载
Python 3.7 + BeautifulSoup 简单爬虫实例
粗略的啃完requests库的官方中文文档和BeautifulSoup的文档,本期主要灵活运用相关知识,实现对freebuf.com文章信息的抓取分析。
muntainyang
2020/10/23
7320
Python 3.7 + BeautifulSoup 简单爬虫实例
10个超酷的H5特效设计+1个仿最新苹果UI设计(压轴)
1.抽屉式(动态)选择 button(纯css实现) html代码:  <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="s
淼学派对
2022/11/20
1.6K0
10个超酷的H5特效设计+1个仿最新苹果UI设计(压轴)
【Python实战】 ---- 爬虫练习 爬取 CSDN 2020 博客之星投票数据
效果 2020 博客之星年度总评选排名 分析网页数据 2020 博客之星年度总评选 页面数据接口分析 2.1 (以谷歌浏览器为例) 浏览器打开2020 博客之星年度总评选 ===》 F12(鼠标右键 ===》 检查) ===》 Network ===》 XHR ===》 在列表中找到数据接口点击 2.2 查看接口和请求方式 当前实例数据接口:https://bss.csdn.net/m/topic/blog_star2020/getUsers 请求方式:POST 2.3 查看请求
Rattenking
2021/09/07
6200
B 站个人名片
效果展示 http://127.0.0.1:5500/bilibili-mingpian.html
ax020913
2023/04/18
6320
第二周实战作业:爬取一万商品数据
由于没有开time.sleep所以会被反扒, 卡死之后一般用ctrl+c停止那个类目爬取……
radaren
2018/08/28
4180
第二周实战作业:爬取一万商品数据
【详细步骤解析】爬虫小练习——爬取豆瓣Top250电影,最后以csv文件保存,附源码
1.发送请求,根据url地址,然后送请求 2.获取数据,获取服务器返回的响应的内容 3.解析数据:提取想要爬取的内容 4.保存数据:将得到的数据保存为文档
小尘要自信
2023/10/10
1.2K0
python爬取豆瓣电影榜单
省略需求到编码中间的繁文缛节,直接上手编码。(此处是最终编码) 目标一使用BeautifulSoup解析页面查找元素。 目标二调用接口处理返回的json数据。
全栈程序员站长
2022/09/01
8530
如何一键展示全平台信息?Python手把手教你搭建自己的自媒体展示平台
灵感源于之前写过的Github中Readme.md中可以插入自己的js图片和动态api解析模块,在展示方面十分的美观:
fanstuck
2024/03/14
2520
如何一键展示全平台信息?Python手把手教你搭建自己的自媒体展示平台
python 爬取mm信息
# -*- coding:utf-8 -*-   import requests from bs4 import BeautifulSoup import sys import re reload(s
py3study
2020/01/14
5410
『Python开发实战菜鸟教程』实战篇:爬虫快速入门——统计分析CSDN与博客园博客阅读数据
推荐补充阅读:『Python开发实战菜鸟教程』工具篇:手把手教学使用VSCode开发Python
小宋是呢
2022/01/05
1.4K0
『Python开发实战菜鸟教程』实战篇:爬虫快速入门——统计分析CSDN与博客园博客阅读数据
爬取58同城二手手机
在开始编写代码前需要将Python3.7安装并配置于环境变量中(windows一般安装python环境后会自动添加进环境变量),以及使用pip命令安装上面提到的3个python库,这些都准备好以后开始使用PyCharm或者Sublime Text 3编写代码,这里我习惯于使用PyCharm编写python代码。 进入58同城的二手手机页面https://gy.58.com/shouji/ ,使用浏览器的开发者工具(直接按F12键即可)寻找页面规律。爬去58同城二手手机的数据。 使用shift+ctrl+c选
暖月寒星
2020/03/12
6750
每日分享html特效篇之一个菜单栏、一个渐变背景、一个加载特效、七个导航栏特效
1.前端工程师主要利用HMTL与CSS建构页面(其中html构建骨架,css构建样式),用JavaScript获取后端数据以及完善交互以及用户体验。 2.通俗来讲,前端在一个项目里,拿到UI设计师设计的设计稿,然后实现UI设计师设计稿,调用后端程序员给的数据接口以获取数据,然后测试,最后部署上线。 3.前端可以对设计图负责,大部分情况下,不需要特别的去理解业务逻辑,因为我们90后都是玩着十几年手机电脑长大的,十几年的经验足够我们在潜意识里想明白应该怎么做,怎么去一步步实现,会有什么意外情况。 4.我感觉前端发展有个很大的缺陷----晋升问题. 正如第三点所言,作为领导必须对项目有足够的了解,显然是要重点包括业务逻辑,这点上,后端开发者需要涉及数据库逻辑,是必须要跟业务逻辑打交道的(重中之重),因此,大部分的领导岗位都是后端开发者更有晋升的机会。当然,个别公司有专门的前端组长(这也不算什么),如果说前端开发者在自己工作范围之外还要腾出时间去研究业务逻辑,属实是觉得出力不讨好(因为这样的操作需要持续很久才能看出效果),而且再怎么研究业务逻辑也不会比每时每刻跟业务逻辑打交道的后端开发者了解更多。说实在的,大部分情况下,前端在配合后端进行开发.后端需要了解业务逻辑,要跟领导和客户商量细节,露脸机会很大,在老板面前刷脸次数众多。这些都是拉开前后端程序员晋升机会差距的因素。
淼学派对
2022/11/20
2.6K0
每日分享html特效篇之一个菜单栏、一个渐变背景、一个加载特效、七个导航栏特效
Python爬虫-selenium
对于Ajax加载的网页已经分析了好几回,这回来说说利用selenium自动化获取网页信息。
小F
2020/10/09
8490
Python爬虫-selenium
我的第一个爬虫,爬取北京地区短租房信息
# 导入程序所需要的库。 import requests from bs4 import BeautifulSoup import time # 加入请求头伪装成浏览器 headers = { #通过Chrome浏览器复制User-Agent 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/5
py3study
2020/01/19
6250
css3之3D转换
css3的3D转换,很有意思的一个特效 用到的属性 transform: rotateX(-175deg);沿着x轴旋转 transform: rotateY(-70deg);沿着y轴旋转 tra
一个淡定的打工菜鸟
2018/09/06
6700
css3之3D转换
京东购物车(动态)网页搭建,利用JavaScript实现
源代码已分享至本人云盘~~~ 链接:https://pan.baidu.com/s/1ul_DbL2KVdETTc6himvfUA 提取码:7wbw
时间静止不是简史
2020/07/24
1.9K0
京东购物车(动态)网页搭建,利用JavaScript实现
AI网络爬虫:批量爬取抖音视频搜索结果
<div class="ILGAlGLX">《梅西的Al道歉》 本年度最佳 Al视频,看来梅西还想在中国淘金,这才是真正的“商业头脑”#梅西 #梅西道歉 #Sora #数字人</div>
AIGC部落
2024/06/24
5200
AI网络爬虫:批量爬取抖音视频搜索结果
推荐阅读
相关推荐
python 爬取淘宝模特信息
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档