随笔分类 -  五天Python闯关训练营(CSDN)

摘要:import urllib.request as ur import lxml.etree as le import user_agent keyword = input('请输入关键词:') pn_start = int(input('起始页:')) pn_end = int(input('终止页 阅读全文
posted @ 2019-11-20 15:22 5572 阅读(239) 评论(0) 推荐(0) 编辑
摘要:import urllib.request as ur import user_agent import lxml.etree as le request = ur.Request( url='https://edu.csdn.net/mycollege', headers={ 'User-Agen 阅读全文
posted @ 2019-11-20 15:16 5572 阅读(173) 评论(0) 推荐(0) 编辑
摘要:import urllib.request as ur proxy_address = ur.urlopen('http://api.ip.data5u.com/dynamic/get.html?order=d314e5e5e19b0dfd19762f98308114ba&sep=4').read().decode('utf-8').strip() print(proxy_address) # 创 阅读全文
posted @ 2019-11-20 15:10 5572 阅读(217) 评论(0) 推荐(0) 编辑
摘要:import urllib.request as ur import user_agent request = ur.Request( url='https://edu.csdn.net/', headers={ 'User-Agent':user_agent.get_user_agent_pc() 阅读全文
posted @ 2019-11-20 15:04 5572 阅读(402) 评论(0) 推荐(0) 编辑
摘要:import urllib.parse as up import urllib.request as ur import json word = input('请输入要翻译的中文') data = { 'kw':word } data_url = up.urlencode(data) request 阅读全文
posted @ 2019-11-20 14:42 5572 阅读(206) 评论(0) 推荐(0) 编辑
摘要:import urllib.parse as up import urllib.request as ur kw = '动漫' data ={ 'kw':kw, 'ie':'utf-8', 'pn':100 } data_url = up.urlencode( data ) ret = up.unq 阅读全文
posted @ 2019-11-20 14:37 5572 阅读(298) 评论(0) 推荐(0) 编辑
摘要:import urllib.request as ur ret = ur.urlopen('https://edu.csdn.net/').read() with open('edu.html','wb') as f: f.write(ret) 阅读全文
posted @ 2019-11-20 14:19 5572 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Http请求协议 阅读全文
posted @ 2019-11-20 14:13 5572 阅读(122) 评论(0) 推荐(0) 编辑
摘要:import json python_data = [ { 'username': 'normal', 'vip': True, }, { 'username':None, 'vip':False }, ] # dumps 用于把python对象转换成json对象 json_data = json.d... 阅读全文
posted @ 2019-11-20 13:59 5572 阅读(235) 评论(0) 推荐(0) 编辑
摘要:如果HTML被注释,Xpath会不起作用,此时应该使用正则表达式 阅读全文
posted @ 2019-11-20 13:24 5572 阅读(502) 评论(0) 推荐(0) 编辑
摘要:课程目标 1、谷歌浏览器配置Xpath 2、Xpath常用语法 3、Xpath常用案例 1、谷歌浏览器配置Xpath Xpath下载:http://chromecj.com/web-development/2018-01/892/download.html xpath helper 是一款chrom 阅读全文
posted @ 2019-11-19 14:10 5572 阅读(156) 评论(0) 推荐(0) 编辑
摘要:import re with open('index.html','r',encoding='utf-8') as f: html = re.sub('\n','',f.read()) section_pattern = '<section class="main_section">(.*?)</s 阅读全文
posted @ 2019-11-19 14:09 5572 阅读(115) 评论(0) 推荐(0) 编辑
摘要:课程目标 1、提取 2、匹配 3、替换 1、提取 2、匹配 3、替换 index.html 阅读全文
posted @ 2019-11-19 13:51 5572 阅读(236) 评论(0) 推荐(0) 编辑
摘要:课程目标 1. 使用模块 2. 安装第三方模块 使用模块 • 一个.Py文件称之为一个模块(Module) • 好处: 1. 便于代码维护,把很多函数放到不同文件,一个.py文件 的 代码数量少 2. 一个模块可以被其他地方引用,代码不必从零写起 3.使用模块还可以避免函数名和变量名冲突。相同名字的 阅读全文
posted @ 2019-11-19 00:52 5572 阅读(187) 评论(0) 推荐(0) 编辑
摘要:课程目标 1. 面向对象编程 2. 类和实例 3. 访问限制 4. 实例属性和类属性 面向对象编程 • 面向对象编程是一种程序设计思想 • 面向对象把类和对象作为程序的基本单元 • 对象包含属性和方法 • 面向过程编程为:函数的调用集合 • 面向对象编程为:对象之间传递信息的集合 • 处处皆对象 类 阅读全文
posted @ 2019-11-19 00:44 5572 阅读(144) 评论(0) 推荐(0) 编辑
摘要:视频地址(全部) https://edu.csdn.net/course/detail/26057 课件地址(全部) https://download.csdn.net/download/gentle__man/11858127 课程目标 1. 了解函数 2. 函数的格式定义 3. 函数文档 4. 阅读全文
posted @ 2019-11-18 23:25 5572 阅读(148) 评论(0) 推荐(0) 编辑
摘要:视频地址(全部) https://edu.csdn.net/course/detail/26057 课件地址(全部) https://download.csdn.net/download/gentle__man/11858127 课程目标 1.while型循环 2.for...in循环 3.rang 阅读全文
posted @ 2019-11-13 14:41 5572 阅读(197) 评论(0) 推荐(0) 编辑
摘要:视频地址(全部) https://edu.csdn.net/course/detail/26057 课件地址(全部) https://download.csdn.net/download/gentle__man/11858127 基础语法 课程目标 1. Python的注释2. Python语法格式 阅读全文
posted @ 2019-10-13 17:28 5572 阅读(300) 评论(0) 推荐(0) 编辑
摘要:视频地址(全部) https://edu.csdn.net/course/detail/26057 课件地址(全部) https://download.csdn.net/download/gentle__man/11858127 课程目标 • Python3语言中内置的基本数据类型 数据类型 • C 阅读全文
posted @ 2019-10-13 09:26 5572 阅读(226) 评论(0) 推荐(0) 编辑
摘要:视频地址(全部) https://edu.csdn.net/course/detail/26057 课件地址(全部) https://download.csdn.net/download/gentle__man/11858127 一、Python环境安装 Python环境包含:1. Python解释 阅读全文
posted @ 2019-10-13 08:40 5572 阅读(232) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩