Python自动化(二)使用Beautifu Soup爬取电影下载链接
来源:互联网 发布:python数据分析入门 编辑:程序博客网 时间:2024/05/17 07:03
#coding:utf-8from bs4 import BeautifulSoupimport requestsimport codecshost = "http://www.poxiao.com"url = "http://www.poxiao.com/mtype5.html"html_doc = requests.get(url).content.decode("GBK")with codecs.open("poxiao.html","w",encoding="GBK") as f: f.write(html_doc)poxiao = BeautifulSoup(html_doc,"lxml")div_content = poxiao.find(name="div",attrs={"class":"content"})movies = div_content.find_all("h3")for movie in movies: print movie.text movie_url = host+movie.a.get("href") movie_content = requests.get(movie_url).content movie_soup = BeautifulSoup(movie_content,"lxml") try: thunder_link = movie_soup.find("input",attrs={"name":"checkbox2"}) print thunder_link.get("value") except: print "获取链接失败"
阅读全文
0 0
- Python自动化(二)使用Beautifu Soup爬取电影下载链接
- Python自动化(一)使用Selenium+PhantomJS爬取电影下载链接
- python 爬取电影下载链接
- Python爬虫实战(八):爬取电影天堂的电影下载链接
- 爬虫学习(一)---爬取电影天堂下载链接
- 使用Scrapy爬取电影链接
- Python3网络爬虫(二):使用Beautiful Soup爬取小说
- htmlparse的简单使用--------爬取电影网页的全部下载链接
- Java爬虫爬取网站电影下载链接
- 使用python爬取豆瓣电影图片(-)
- Python多线程爬虫获取电影下载链接
- Python爬取豆瓣电影
- Python爬取豆瓣电影
- Python爬取豆瓣电影
- Python 爬取豆瓣电影Top250(一)
- Python Scrapy(2)-爬取豆瓣电影详解
- Python3网络爬虫(七):使用Beautiful Soup爬取小说
- Python3网络爬虫:使用Beautiful Soup爬取小说
- 第二周项目三 体验复杂度
- 机器学习的框架、平台、系统、库和工具包的列表
- 1026. Table Tennis (30)
- dockers(四)Dockerfile 指令
- 非平衡数据集的机器学习常用处理方法
- Python自动化(二)使用Beautifu Soup爬取电影下载链接
- javaEE 自学备份整理
- 第二周【项目2
- 1027. Colors in Mars (20)
- 远程桌面连接的利器-mRemote介绍
- IDEA17配置SpringMVC及HelloWorld例子
- 34.Java基础语法
- ecos vector.S 分析I: 主干部分
- div中文字超长的换行神器:word-break:break-all;