![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python爬虫
wyyyyyyyy_
这个作者很懒,什么都没留下…
展开
-
Python网络爬虫入门(一)
ProxyHandler处理器(代理设置) handler=request.ProxyHandler({"http":"218.66.161.88:31769}) #http请求方式 #218.66.161.88代理服务器IP地址 #31769代理服务器监管的端口号 #西刺免费代理IP,快代理,代理云 opener=request.build_opener(handler) rep=reques...原创 2019-03-31 20:50:53 · 151 阅读 · 0 评论 -
Python网络爬虫入门(三)
XPath详解 选取节点 namenode 选取namenode底下所有子节点 / 选取根元素下所有的bookstore节点 // 从全局节点中找到所有的bookstore节点 @ //book[@price]选择所有拥有price属性的book节点 谓词 /bookstore/book[1] ...原创 2019-04-12 11:26:47 · 198 阅读 · 0 评论 -
Python网络爬虫入门(二)
requests库 import requests response= requests.get("url") print(response.content.decode('utf-8')) params={'wd':'中国'} headers={} response=requests.get("url",params=params,headers=headers) print(response....原创 2019-04-03 12:14:51 · 140 阅读 · 0 评论 -
Python网络爬虫入门(四)
BeautifulSoup库 from bs4 import BeautifulSoup html=""" """ soup=BeautifulSoup(html,'lxml') #打印所有的tr标签 trs=soup.find_all('tr') for tr in trs: print(tr) #获取第二个tr标签 tr=soup.find_all('tr',limit=2)[1]#li...原创 2019-05-07 16:38:51 · 228 阅读 · 0 评论