当前位置: 首页 > news >正文

网站托管平台什么语言做网站快

网站托管平台,什么语言做网站快,响应页手机网站源码,自己买服务器建网站本项目纯学习使用。 1 scrapy 代码 爬取逻辑非常简单#xff0c;根据url来处理翻页#xff0c;然后获取到详情页面的链接#xff0c;再去爬取详情页面的内容即可#xff0c;最终数据落地到excel中。 经测试#xff0c;总计获取 11299条中医药材数据。 import pandas as…本项目纯学习使用。 1 scrapy 代码 爬取逻辑非常简单根据url来处理翻页然后获取到详情页面的链接再去爬取详情页面的内容即可最终数据落地到excel中。 经测试总计获取 11299条中医药材数据。 import pandas as pd import scrapyclass ZhongyaoSpider(scrapy.Spider):name zhongyaostart_urls [fhttps://www.zysj.com.cn/zhongyaocai/index__{i}.html for i in range(1, 27)]def __init__(self, *args, **kwargs):self.data []def parse(self, response):for li in response.css(div#list-content ul li):a_tag li.css(a)title a_tag.css(::attr(title)).get()href a_tag.css(::attr(href)).get()if title and href:# 构建完整的详情页 URLdetail_url response.urljoin(href)yield scrapy.Request(detail_url, callbackself.parse_detail, meta{title: title})# 解析逻辑def parse_detail(self, response):title response.meta[title]pinyin response.css(div.item.pinyin_name_phonetic div.item-content::text).get(default).strip()alias response.css(div.item.alias div.item-content p::text).get(default).strip()english_name response.css(div.item.english_name div.item-content::text).get(default).strip()source response.css(div.item.alias div.item-content p::text).get(default).strip()# 性味flavor response.css(div.item.flavor div.item-content p::text).get(default).strip()functional_indications response.css(div.item.flavor div.item-content p::text).get(default).strip()usage response.css(div.item.usage div.item-content p::text).get(default).strip()excerpt response.css(div.item.excerpt div.item-content::text).get(default).strip()#habitat response.css(div.item.habitat div.item-content p::text).get(default).strip()# 出处provenance response.css(div.item.provenance div.item-content p::text).get(default).strip()# 性状shape_properties response.css(div.item.shape_properties div.item-content p::text).get(default).strip()# 归经attribution response.css(div.item.attribution div.item-content p::text).get(default).strip()# 原形态prototype response.css(div.item.prototype div.item-content p::text).get(default).strip()# 名家论述discuss response.css(div.item.discuss div.item-content p::text).get(default).strip()# 化学成分chemical_composition response.css(div.item.chemical_composition div.item-content p::text).get(default).strip()item {title: title,pinyin: pinyin,alias: alias,source: source,english_name: english_name,habitat: habitat,flavor: flavor,functional_indications: functional_indications,usage: usage,excerpt: excerpt,provenance: provenance,shape_properties: shape_properties,attribution: attribution,prototype: prototype,discuss: discuss,chemical_composition: chemical_composition,}self.data.append(item)yield itemdef closed(self, reason):# 当爬虫关闭时保存数据到 Excel 文件df pd.DataFrame(self.data)df.to_excel(zhongyao_data.xlsx, indexFalse)2 爬取截图 3 爬取数据截图
http://www.w-s-a.com/news/565391/

相关文章:

  • 自学网站编程网站名称需要注册吗
  • 网站后台管理系统怎么添加框安徽省工程建设协会网站
  • 雨花台网站建设wordpress找回
  • 四川哪家网站推广做的好网站开发人才需求
  • 什么网站可以找手工活做一站式服务平台官网
  • 做购物网站的步骤网站核心词如何做
  • 做品牌设计网站公司网站没做301怎么做301
  • 服务流程企业网站wordpress文章的使用
  • 网站开发组合淘宝网站开发选什么类目
  • 广东手机网站建设个人电脑做网站主机
  • 健身俱乐部网站开发文档建一个网站需要什么条件
  • 买的网站模板怎么做建设行政管理部门网站
  • 怎么让百度多收录网站关键词seo深圳
  • 陕西交通建设集团网站体检个人网站设计模板田田田田田田田田
  • ae模板网站推荐安徽建筑信息平台
  • 新网站建设代理商wordpress模板商店
  • 中国十大设计素材网站wordpress发布失败
  • 江西省建设监理网站网页制作与设计是什么
  • 在招聘网站做销售怎么样网址你懂我意思正能量不用下载ios
  • 高端企业网站定制公司企业网站2000元
  • 成都网站建设:河北省建设工程质量监督网站
  • 四川省建设厅官网信息查询平台北京seo关键词优化外包
  • 网站建设响应式是什么意思wordpress弹窗打开网页
  • 做美工需要参考的网站漳州做网站的公司
  • 用源码建设网站关于网站开发的自我评价
  • 网站设计师图片自助建站编辑器
  • 网站建设的常用技术有哪些深圳建筑工地招工
  • 做软装找图片的网站wordpress 替代
  • 制作网站的后台公众号做视频网站会封吗
  • 广西企业建站邯郸景区网站制作