摘要:
arr = ["http://music.163.com/song/media/outer/url?id=1820550501.mp3", "http://music.163.com/song/media/outer/url?id=1820550501.mp3", "http://music.163 阅读全文
摘要:
<div class="video"> <iframe height=180 width=10% src='https://player.youku.com/embed/XMzQzNjc2MTYwNA==' frameborder=0 allowfullscreen=1></iframe> </di 阅读全文
摘要:
# os.path.exists(path) 判断一个目录是否存在 # 2、os.makedirs(path) 多层创建目录 # 3、os.mkdir(path) 创建目录 import os def mkdirs(url): url = "D:/4KSite/fengjing/" if not o 阅读全文
摘要:
基本语法: 属性定位: #找到class属性值为song的div标签 //div[@class="song"] 层级&索引定位: #找到class属性值为tang的div的直系子标签ul下的第二个子标签li下的直系子标签a //div[@class="tang"]/ul/li[2]/a 逻辑运算: 阅读全文
摘要:
爬取小说水浒传 代码例子: # # 先下载需要的包 # pip install bs4 # pip install lxml from bs4 import BeautifulSoup # 小说网 水浒传 url = "http://book.zongheng.com/showchapter/681 阅读全文
摘要:
直接上代码: import re import requests # 创建定长数字,作为一会名字 def creat_fivenum(num,n=5): for i in range(1,10): s=str(num) j=10**i if (int(num/j)==0): for a in ran 阅读全文
摘要:
requests 详细了解一下爬虫 #1爬虫究竟是合法还是违法的? # 在法律上不被禁止 算是中立性 # 2爬虫所带来风险主要体现在以下2个方面: # 爬虫干扰了被访问网站的正常运营; # 爬虫抓取了受到法律保护的特定类型的数据或信息。 # 爬虫的分类 # 通用爬虫:通用爬虫是搜索引擎(Baidu、 阅读全文
摘要:
UA伪装 < >UA检测:门户网站会检测对应请求的载体身份标识,如果是浏览器那就认为是正常用户 headers headers = { 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8', 'Us 阅读全文
摘要:
<script> //显示时间 setInterval(function() { var myDate = new Date; var year = myDate.getFullYear(); //获取当前年 var mon = myDate.getMonth() + 1; //获取当前月 var 阅读全文
摘要:
写作不易:我是阿森 不上图了,显得很乱 效果直接看我博客就看到啦 .navbar a:hover{color:#666;text-decoration:underline}.navbar a:link,.navbar a:active,.navbar a:visited{color:#666;tex 阅读全文