beautifusouptest
from bs4 import BeautifulSoup
import urllib.request
url = "http://www.douban.com/tag/%E5%B0%8F%E8%AF%B4/?focus=book"
res = urllib.request.urlopen(url) soup = BeautifulSoup(res,'lxml')
book_div = soup.find(attrs={'id':"book"})
book_a = book_div.findAll(attrs={"class":'desc'})
for book in book_a :
print(book.string)
beautifusouptest的更多相关文章
随机推荐
- 参考消息 Android 读报
<参考消息>是新华通讯社主办,参考消息报社编辑出版的日报,创刊于1931年,历史长达80年.<参考消息>每天及时选载世界各国(地区)通讯社.报刊及因特网上的最新消息.评论的精华 ...
- WinForm form属性
一.布局 Autostroll 控件内容大于可见区域是否自动显示滚动条 Maximumsize 窗体可调到最大尺寸 minimumsize 窗体可调到最小尺寸 size 窗体看到的尺寸 Sta ...
- git的常用操作指令
git学习网址: http://www.backlogtool.com/git-guide/cn/intro/intro2_3.html 廖雪峰的git教程 git的工作区和暂存区(描述git的工作流 ...
- Windows Experience Index
The Windows Experience is still there--even in build 9860. However, the GUI was retired with Window ...
- 有关mybatis的动态sql
一般地,实现动态SQL都是在xml中使用等标签实现的. 我们在这里使用SQL构造器的方式, 即由abstract sql写出sql的过程, 当然感觉本质上还是一个StringBuilder, 来手动生 ...
- java 自定义容器,实现foreach
import java.util.Arrays; import java.util.Iterator; public class ArrayList implements Iterable<In ...
- c++ 拷贝资源方法
#include "stdio.h" #include "stdlib.h" #include <sys/types.h> #include < ...
- iOS 后台传输服务
后台传输服务 — 我们用水壶来比喻 (0:14) 后天传输服务是 iOS 7 引进的 API,它准许应用暂停或者中止之后,在后台继续执行网络服务(比如下载或者上传).举个例子,这正是 Dropbox ...
- DD命令做备份和恢复
正确的备份方法是先挂载移动硬盘分区:mount /dev/sdb5 /mnt 然后再备份:dd if=/dev/sda of=/mnt/backup_sda.img 恢复时同样要先挂载,再恢复:mou ...
- 配置淘宝镜像,不使用怪异的cnpm
npm config set registry https://registry.npm.taobao.org --global npm config set disturl https://npm. ...