Python之爬虫-段子网
生活随笔
收集整理的這篇文章主要介紹了
Python之爬虫-段子网
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Python之爬蟲-段子網
https://ishuo.cn
#!/usr/bin/env python # -*- coding:utf-8 -*- import re import requestsresponse = requests.get('https://ishuo.cn') data = response.text print(data) r = re.findall('<div class="content">(.*?)</div>',data) for i in r:print(i)http://duanziwang.com/
#!/usr/bin/env python # -*- coding:utf-8 -*- import re import requestsresponse =requests.get('http://duanziwang.com/') data = response.text result = re.findall('<a href="http://duanziwang.com/.*?.html">(.*?)</a>',data)for i in result:print(i)轉載于:https://www.cnblogs.com/nickchen121/p/10825887.html
總結
以上是生活随笔為你收集整理的Python之爬虫-段子网的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《阿凡达:重返潘多拉》亮相迪士尼D23
- 下一篇: python类和实例化