37,721
社区成员
发帖
与我相关
我的任务
分享
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from pyquery import PyQuery as pq
import urllib
u = 'http://www.7dsw.com/toplastupdate/1.html'
p = urllib.urlopen(u)
pp = p.read().decode('gbk')
d = pq(pp)
sep = d('#newscontent ul a').text()
for s in sep.split(' '):
print s
上面代码中的 '#newscontent ul a 语法和css或者jquery是一致的。。。。。