前言
相信大家刚开始在做爬虫的时候,是不是requests和sound这两个库来使用,这样确实有助于我们学习爬虫的知识点,下面来介绍一个算事较复杂的爬虫案例selenium进形打开浏览器爬取网站的信息
导入第三方库
![webp](https://upload-images.jianshu.io/upload_images/16959493-5ceb9f203172937b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/582/format/webp)
自执行函数
![webp](https://upload-images.jianshu.io/upload_images/16959493-94a4d4eb882d497d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/411/format/webp)
学习从来不是一个人的事情,要有个相互监督的伙伴,工作需要学习python或者有兴趣学习python的伙伴可以私信回复小编“学习” 获取资料,一起学习
解析信息
![webp](https://upload-images.jianshu.io/upload_images/16959493-d23177c47f839143.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/769/format/webp)
保存文件信息
![webp](https://upload-images.jianshu.io/upload_images/16959493-5dcb75ed8c4bc299.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/679/format/webp)
打开浏览器
![webp](https://upload-images.jianshu.io/upload_images/16959493-63f86409545a2534.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/464/format/webp)
获取链接信息
![webp](https://upload-images.jianshu.io/upload_images/16959493-13f0b26e44d6e099.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/528/format/webp)
执行函数
![webp](https://upload-images.jianshu.io/upload_images/16959493-7d387d999ad0e718.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/440/format/webp)
运行结果
![webp](https://upload-images.jianshu.io/upload_images/16959493-de5127b59d800891.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69912078/viewspace-2641231/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/69912078/viewspace-2641231/