会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hanyr
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
下一页
2022年6月12日
【爬虫】bs4
摘要: # -*- coding:utf-8 -*- # 1、拿到页面源代码 # 2、使用bs4解析,拿到数据 import requests from bs4 import BeautifulSoup import csv url = "http://www.xinfadi.com.cn/marketan
阅读全文
posted @ 2022-06-12 18:29 hanyr
阅读(38)
评论(0)
推荐(0)
2022年6月8日
【python】练习0608
摘要: #!/usr/bin/env python # -*- coding: utf-8 -*- import requests import csv import json def test(): f = open("D:/YMM/pythonscript/hyr/file/dmpt个人任务.csv",
阅读全文
posted @ 2022-06-08 14:47 hanyr
阅读(25)
评论(0)
推荐(0)
2022年6月3日
【爬虫】电影天堂-热片
该文被密码保护。
阅读全文
posted @ 2022-06-03 16:34 hanyr
阅读(73)
评论(0)
推荐(0)
2022年5月29日
【爬虫】豆瓣电影
摘要: # -*- coding:utf-8 -*- # Filename:test_豆瓣250.py import requests import re import csv def douban_film(): header = { "User-Agent": "Mozilla/5.0 (Macinto
阅读全文
posted @ 2022-05-29 22:42 hanyr
阅读(34)
评论(0)
推荐(0)
2022年5月17日
【re模块】
摘要: # -*- coding:utf-8 -*- # @Time : 2022/5/17 22:22 # Author:hanyr # Filename:re模块.py import re # findall匹配字符串中所有符合正则的内容 lst = re.findall(r"\d+", "我的电话号码
阅读全文
posted @ 2022-05-17 22:51 hanyr
阅读(32)
评论(0)
推荐(0)
2022年5月15日
【正则表达式】
摘要: 三种解析方式 1、re解析(正则表达式) 2、bs4解析 3、xpath解析 正则表达式 Regular Expression,一种使用表达式的方式对字符串进行匹配的语法规则 优点:速度快,效率高,准确性高 缺点:难度高 正则语法:使用元字符进行排列组合用来匹配字字符串,在线测试正则表达式:http
阅读全文
posted @ 2022-05-15 10:20 hanyr
阅读(28)
评论(0)
推荐(0)
2022年5月14日
【python】爬虫
摘要: # 国外路径 pip install request # 国内源镜像路径(清华) pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests import requests key=input("请输入你要查询的内容:") url
阅读全文
posted @ 2022-05-14 17:55 hanyr
阅读(38)
评论(0)
推荐(0)
2022年5月8日
【python】爬虫
摘要: 反爬协议查看:baidu.com/robots.txt # -*- coding:utf-8 -*- # 爬虫:通过编写程序来获取到互联网上的资源 # 需求:用程序模拟浏览器,输入一个网址,从该网址中获取到资源或内容 from urllib.request import urlopen url =
阅读全文
posted @ 2022-05-08 11:31 hanyr
阅读(24)
评论(0)
推荐(0)
【GUI】练习
该文被密码保护。
阅读全文
posted @ 2022-05-08 11:10 hanyr
阅读(1)
评论(0)
推荐(0)
2022年5月4日
【GUI】布局管理器
该文被密码保护。
阅读全文
posted @ 2022-05-04 18:17 hanyr
阅读(4)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
下一页
公告