【pyQuery】抓取startup news首页

#! /usr/bin/python
# coding: utf-8
from pyquery import PyQuery

c=PyQuery('http://news.dbanotes.net/')

titles=c.find('.title')
    
for t in titles:
    title=c(t).find('a')
    t1=title('a').text()
    h1=title('a').attr('href')
    if t1!=None:
        print t1,'\n\t',h1
        

 

你可能感兴趣的:(startup)