美文网首页
数据分析 | 三、python爬虫实现

数据分析 | 三、python爬虫实现

作者: 侯遇山 | 来源:发表于2017-12-14 21:41 被阅读0次

一、创建python文件,导入相关的库

1.1  导入BeautifulSoup4、requests、lmxl库

       import requests

       from bs4  import BeautifulSoup

       from lxml import html

附1:BeautifulSoup4文档:

https://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html

1.2 实现代码:

      指定url =“要爬取网页的网址”

代码来自:http://blog.csdn.net/csqazwsxedc/article/details/68498842

1.3  print(result)便输出了爬取的内容。

相关文章

网友评论

      本文标题:数据分析 | 三、python爬虫实现

      本文链接:https://www.haomeiwen.com/subject/duklwxtx.html