会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
code never lies
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
20
下一页
2019年3月20日
python 爬取豆瓣的美剧/url解码
摘要: pc版大概有500条记录,mobile大概是50部,只有热门的,所以少一点 url构造很简单,主要参数就是page_limit与page_start,每翻一页,start+=20即可,tag是"美剧"编码后的结果,直接带着也可以,用unquote解码也可以,注意headers中一定要带上refer
阅读全文
posted @ 2019-03-20 21:00 tele
阅读(718)
评论(0)
推荐(0)
2019年3月17日
simple java mail
摘要: 标题和内容尽量用正常的内容,否则会被标识为垃圾邮件,被系统退回,附件越大,发送的时间越长
阅读全文
posted @ 2019-03-17 19:31 tele
阅读(757)
评论(0)
推荐(0)
2019年3月14日
python 遍历文件夹
摘要: 1 import os 2 3 4 # 遍历文件夹 5 def walkFile(file): 6 for root, dirs, files in os.walk(file): 7 8 # root 表示当前正在访问的文件夹路径 9 # dirs 表示该文件夹下的子目录名list 10 # fil
阅读全文
posted @ 2019-03-14 21:57 tele
阅读(26790)
评论(0)
推荐(0)
python os操作
摘要: 1 # 常用的文件管理操作 2 # https://www.cnblogs.com/dkblog/archive/2011/03/25/1995537.html 3 import os 4 import shutil 5 6 # 切换工作目录,默认是在当前目录下 7 # os.chdir("xx") 8 9 # 当前的工作目录 D:\pythonworkspace\py_...
阅读全文
posted @ 2019-03-14 21:54 tele
阅读(844)
评论(0)
推荐(0)
python io操作
摘要: 一次性读取 逐行读取 逐行读取并写入 字节流
阅读全文
posted @ 2019-03-14 21:51 tele
阅读(456)
评论(0)
推荐(0)
python request 代理/超时/证书
摘要: 1 import requests 2 3 headers = { 4 "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" 5 } 6 7 proxies = {...
阅读全文
posted @ 2019-03-14 21:36 tele
阅读(699)
评论(0)
推荐(0)
python tuple
摘要: 1 # tuple中的元素无法修改(但如果元素是列表则可以修改) 2 3 # 创建空tuple 4 5 tuple_empty = () 6 7 # 创建只含有一个元素的tuple 8 tuple_first = ("ok",) 9 10 11 # 获取tuple中的值 12 tuple_first = ("ok", 123, "hello") 13 print(tu...
阅读全文
posted @ 2019-03-14 21:31 tele
阅读(171)
评论(0)
推荐(0)
python dict
摘要: 1 # 字典是一种无序的集合,通常用于描述某个对象的信息 2 user = { 3 "name": "wyc", 4 "age": 22, 5 "gender": "male" 6 } 7 8 # 取值 9 print(user["name"]) 10 11 # 根据key来取值,不存在则返回设置的值 12 pr...
阅读全文
posted @ 2019-03-14 21:29 tele
阅读(175)
评论(0)
推荐(0)
python request post
摘要: 没法实现较长的词汇翻译,大概只能4个单词,超过就请求失败
阅读全文
posted @ 2019-03-14 21:20 tele
阅读(1406)
评论(0)
推荐(0)
python request get
摘要: 1 import requests 2 from urllib import parse 3 4 # 返回response 5 resp = requests.get("https://www.baidu.com") 6 7 # 查看状态码 8 print(resp.status_code) 9 10 11 # 查看响应编码 ISO-8859-1 12 print(re...
阅读全文
posted @ 2019-03-14 21:16 tele
阅读(2914)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
20
下一页
公告