2019年9月28日

ajax get post

摘要: 在post请求中直接将表单数据data转移之后不用拼接,在请求数据的时候在尾部加入即可。 阅读全文

posted @ 2019-09-28 17:49 ybl20000418 阅读(70) 评论(0) 推荐(0) 编辑

2019年9月24日

爬取豆瓣电影

摘要: 代码 # _*_ coding::utf_8 _*_ import re import urllib.parse import urllib.request url='https://movie.douban.com/j/search_subjects?type=movie&tag=%E7%A7%91%E5%B9%BB&sort=rank&' # page=int(input("请输入要查询的... 阅读全文

posted @ 2019-09-24 22:13 ybl20000418 阅读(94) 评论(0) 推荐(0) 编辑

post get 请求 headers注释哪些

摘要: post和get #post请求fomdata=urllib.parse.urlencode(fomdata).encode() request=urllib.request.Request(url=url,headers=headers) response=urllib.request.urlopen(request,fomdata) print(response.read().decode() 阅读全文

posted @ 2019-09-24 21:36 ybl20000418 阅读(639) 评论(0) 推荐(0) 编辑

matlab 子图像subplot

摘要: h =subplot(m,n,p) m 代表行 n 代表列 p 代表的这个图形画在第几行、第几列。 lena图的源代码: 综合: I=imread('lena.jpg'); figure,imshow(I); I1=rgb2gray(I); figure,imshow(I1); Noise=imno 阅读全文

posted @ 2019-09-24 16:34 ybl20000418 阅读(431) 评论(0) 推荐(0) 编辑

2019年9月23日

post请求get请求

摘要: post请求 # _*_ coding::utf_8 _*_ import urllib.request import urllib.parse # 开始url、(word、data在一块)headers请求头 post_url='https://fanyi.baidu.com/sug' word=input('输入查询单词:') form_data={ 'kw':word, } he... 阅读全文

posted @ 2019-09-23 22:07 ybl20000418 阅读(117) 评论(0) 推荐(0) 编辑

2019年9月22日

UA伪装

摘要: # _*_ coding::utf_8 _*_ import urllib.request import urllib.parse url="https://www.bilibili.com/" headers={ 'User-Agent':'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (K 阅读全文

posted @ 2019-09-22 21:40 ybl20000418 阅读(132) 评论(0) 推荐(0) 编辑

2019年9月21日

urllib.request encode()/decode()

摘要: urllib.request urlopen(url)#直接打开相应的url urlretrieve(url,image_path)#打开url直接将图片存储,后面为图片存储地址 encode()/decode()小括号里面不写参数,默认是utf8,写只能写gbk。 阅读全文

posted @ 2019-09-21 21:27 ybl20000418 阅读(311) 评论(0) 推荐(0) 编辑

urllib.parse quote/unquate/urlencode

摘要: quote :url编码函数,将中文进行转化为%xxxx # _*_ coding::utf_8 _*_ import urllib.request import urllib.parse url='http://baidu.com/index.html?name=杨洪&pwd=123456' ret=urllib.parse.quote(url) ret1=urllib.parse.unqu... 阅读全文

posted @ 2019-09-21 21:23 ybl20000418 阅读(317) 评论(0) 推荐(0) 编辑

python 爬取图片

摘要: 得到url response=urllib.request.urlopen(url)打开获得的url response.read().decode()# decode()将读出的信息以二进制字节形式打开, 将获得的文件输出,有方法一,方法二、方法三可以直接进行传数 方法一: with open(r' 阅读全文

posted @ 2019-09-21 20:15 ybl20000418 阅读(108) 评论(0) 推荐(0) 编辑

2019年9月19日

二叉树满二叉树完全二叉树

摘要: 二叉树只能有两个分支 完全二叉树是满二叉树的一个特例 当一个二叉树的标号与其对应的满二叉树的标号可以对应的时候,该二叉树称为完全二叉树 阅读全文

posted @ 2019-09-19 18:46 ybl20000418 阅读(104) 评论(0) 推荐(0) 编辑

导航