• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python使用beautifulsoup从爱奇艺网抓取视频播放

python使用beautifulsoup从爱奇艺网抓取视频播放

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python beautifulsoup,beautifulsoup,beautifulsoup安装,beautifulsoup官网,beautifulsoup下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

response = urllib.request.urlopen('http://www.iqiyi.com/a_19rrgja8xd.html')
html = response.read()
soup = BeautifulSoup(html)
dramaList = soup.findAll('div', attrs={'class':'list_block1 align_c'})
dramaItems = []

if(dramaList):
    lis = dramaList[0].findAll('li')
    for li in lis:
        ps = li.findAll('p')
        description = ps[1].text if len(ps)>1 else ''
        num = ps[0].find('a').text
        url = ps[0].find('a')['href']
        di = DramaItem(num, description, url)
        dramaItems.append(di)

for di in dramaItems:
    print(di)
diLen = len(dramaItems)
userChoice = int(input('input number to watch the drama:'))
if userChoice >= 1 and userChoice <=diLen:
    dramaItems[userChoice-1].openDrama()

</div>

</div>

您可能想查找下面的文章:

  • Python利用Beautiful Soup模块创建对象详解
  • Python利用Beautiful Soup模块修改内容方法示例
  • Python利用Beautiful Soup模块搜索内容详解
  • Python利用Beautiful Soup模块创建对象详解
  • Python利用Beautiful Soup模块修改内容方法示例
  • Python使用BeautifulSoup库解析HTML基本使用教程
  • python基于BeautifulSoup实现抓取网页指定内容的方法
  • Python中使用Beautiful Soup库的超详细教程
  • Python中使用Beautiful Soup库的超详细教程
  • python使用BeautifulSoup分页网页中超链接的方法

相关文章

  • 讲解python参数和作用域的使用
  • Python中无限元素列表的实现方法
  • 在Python中处理时间之clock()方法的使用
  • python检查URL是否正常访问的小技巧
  • python实现一次创建多级目录的方法
  • Python格式化css文件的方法
  • Python功能键的读取方法
  • python检测服务器是否正常
  • python判断字符串编码的简单实现方法(使用chardet)
  • Python同时向控制台和文件输出日志logging的方法

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python查找函数f(x)=0根的解决方法
    • php使用递归与迭代实现快速排序示例
    • Python中is与==判断的区别
    • Django发送html邮件的方法
    • 在SAE上部署Python的Django框架的一些问题汇总
    • Python运行的17个时新手常见错误小结
    • python基础教程之实现石头剪刀布游戏示例
    • Python入门篇之编程习惯与特点
    • Python使用Mechanize模块编写爬虫的要点解析
    • 用Python脚本来删除指定容量以上的文件的教程

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有