一、创建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/684988421.3 print(result)便输出了爬取的内容。
网友评论