import scrapy
class CsProductSpider(scrapy.Spider):
name = "cs_product"
allowed_domains = ["www.cs.ecitic.com"]
start_urls = ["http://www.cs.ecitic.com/newsite/cpzx/jrcpxxgs/zgcp/index.html"]
def parse(self, response):
# 提取数据的逻辑,根据实际情况调整
list_con = response.css('.list-con li')
for item in list_con:
product_name = item.css('.th1::text').get()
manager = item.css('.th2::text').get()
risk_rating = item.css('.th3::text').get()
subscription_amount = item.css('.th4::text').get()
yield {
"产品名称": product_name,
"管理人": manager,
"风险评级": risk_rating,
"认购金额起点": subscription_amount,
"公示信息详情链接": None
}
# 检查是否有页码导航,如果有则遍历页码进行翻页
page_nav =