您当前的位置: 首页 >  网络

默默爬行的虫虫

暂无认证

  • 1浏览

    0关注

    84博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

autoscraper网络刮板模块总结

默默爬行的虫虫 发布时间:2022-07-06 15:45:25 ,浏览量:1

autoscraper网络刮板模块总结
  • requests——最普遍使用的爬虫库
  • you_get——最受欢迎的爬虫库
  • autoscraper——最智能的爬虫库
  • urllib——最底层的爬虫库
  • Httpx ——支持异步与Http2.0协议的爬虫库
1. 安装
# 首先安装autoscraper,目前只支持python3 
 
# 使用 pip 从 git 仓库安装最新版本 
# pip install git+https://github.com/alirezamika/autoscraper.git 
 
# 下载源码安装 
# python setup.py install 
 
# 从 PyPI 安装(推荐) 
# pip install autoscraper 

实例1

from autoscraper import AutoScraper

url = 'https://stackoverflow.com/questions/2081586/web-scraping-with-python'

# We can add one or multiple candidates here.
# You can also put urls here to retrieve urls.
wanted_list = ["What are metaclasses in Python?"]

scraper = AutoScraper()
result = scraper.build(url, wanted_list)
for i in result:
    print(i)

在这里插入图片描述 案例2

            
关注
打赏
1658895887
查看更多评论
立即登录/注册

微信扫码登录

0.0354s