当前位置: 首页 > 工具软件 > StartupNews > 使用案例 >

【pyQuery】抓取startup news首页

乐正烨熠
2023-12-01
#! /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
        

 

转载于:https://www.cnblogs.com/lizunicon/p/3516526.html

 类似资料: