1.1 方法一

python爬虫笔记(五)网络爬虫之提取—信息组织与提取方法(2)信息提取的一般方法

1.2 方法2

python爬虫笔记(五)网络爬虫之提取—信息组织与提取方法(2)信息提取的一般方法

1.3 方法3

python爬虫笔记(五)网络爬虫之提取—信息组织与提取方法(2)信息提取的一般方法

2. 实例

python爬虫笔记(五)网络爬虫之提取—信息组织与提取方法(2)信息提取的一般方法

import requests
from bs4 import BeautifulSoup

r = requests.get("http://python123.io/ws/demo.html")

demo = r.text

print(demo, "\n")

soup = BeautifulSoup(demo, "html.parser")

for link in soup.find_all('a'):
    print(link.get('href'))

python爬虫笔记(五)网络爬虫之提取—信息组织与提取方法(2)信息提取的一般方法

 

相关文章:

  • 2022-01-25
  • 2021-12-20
  • 2021-09-19
  • 2021-06-16
  • 2021-05-19
  • 2021-12-02
猜你喜欢
  • 2021-11-15
  • 2022-02-16
  • 2021-04-17
  • 2021-06-02
  • 2021-12-20
  • 2021-11-13
相关资源
相似解决方案