美文网首页
Python爬虫基础知识

Python爬虫基础知识

作者: shadowflow | 来源:发表于2018-09-27 20:58 被阅读0次

1. Python相关库

  • requests、re
  • BeautifulSoup
  • hackhttp

2 BeautifulSoup

2.1 解析内容

from bs4 import BeautifulSoup
soup = BeautifulSoup(html_doc)

2.2 浏览数据

soup.title
soup.title.string

2.3 BeatifulSoup正则使用

soup.find_all(name='x',attrs={'xx':re.compile('xxx')})

3 hackhttp

能发送整个数据包

相关文章

网友评论

      本文标题:Python爬虫基础知识

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