摘要:        
re解析(运行速度最快) . 匹配换行符以外的任意字符 \w 匹配字母或数字或下划线 \s 匹配任意的空白符 \d 匹配数字 \n 匹配一个换行符 \t 匹配一个制表符 ^ 匹配字符串的开始 $ 匹配字符串的结尾 \W 匹配非字母或数字或下划线 \D 匹配非数字 \S 匹配非空白符 a|b 匹配字符    阅读全文
posted @ 2021-06-22 18:04
YuyuFishSmile
阅读(110)
评论(0)
推荐(0)
        
            
        
        
摘要:        
通过爬取豆瓣的电影排行榜 import requests url = "https://movie.douban.com/j/chart/top_list" #params是get请求带参数 #data是post请求带参数 #重新进行封装参数 param = { "type":"24", "inte    阅读全文
posted @ 2021-06-22 16:08
YuyuFishSmile
阅读(419)
评论(0)
推荐(0)
        
            
        
        
摘要:        
不是python自带的,需要安装pip install requests import requests url = 'https://cn.bing.com/search?q=%E8%B1%86%E7%93%A3' #请求网页url一般是get请求,这里用requests的get方法 res =     阅读全文
posted @ 2021-06-22 15:42
YuyuFishSmile
阅读(176)
评论(0)
推荐(0)
        
            
        
        
摘要:        
from urllib.request import urlopen #打开网址,得到一个响应,利用python自带的urlopen url = "http://www.baidu.com" resp = urlopen(url) result = resp.read() from urllib.r    阅读全文
posted @ 2021-06-22 09:33
YuyuFishSmile
阅读(168)
评论(0)
推荐(0)
        
 
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号