# 清远市人民政府 · 中心资讯 (zxzx) 区
# https://www.gdqy.gov.cn/gdqy/zxzx/
#
# 注：清远市本级 (gdqy.gov.cn) 同时挂着 gkmlpt API 平台（site_code=
# gdqy_gkmlpt, cms_adapter=gkmlpt）和这套传统 HTML 列表页 (zxzx, zwgk1,
# 部门动态 …)。本 yaml 只覆盖 HTML 那一边；URL 路径形如 /gdqy/<area>/。
#
# **重要**：gdqy.gov.cn 部署 ctct 反爬盾。default_strategy=playwright，
# 第一次访问触发 JS 挑战拿 cookie；之后 cookie 池命中则退回 httpx。
#
# DOM 结构（2026-04-27 实测，与各县区 NF-CMS 模板一致）：
#   列表: <div class="pageList listContent">
#           <li><a href title>标题</a><span>YYYY-MM-DD</span></li> × N
#         </div>
#         分页: index_2.html / index_3.html …
#   详情: <h1.article-title>标题</h1>
#         <div class="article-attr">
#           <span class="date">时间：<b>YYYY-MM-DD HH:MM:SS</b></span>
#           <span class="ly">来源：<b>来源</b></span>
#         </div>
#         <div class="article-content">正文…</div>
#
# default_column 兜底任意 column_id —— admin UI 通过 discover-html +
# bulk-create-yaml 添加新栏目都不用改本 yaml。

site_id: gdqy_zxzx
site_name: 清远市·中心资讯
base_url: https://www.gdqy.gov.cn
default_strategy: playwright   # ctct 盾，首次必须走 playwright
concurrency: 1
interval_sec: 10
enabled: true
respect_robots: true

default_column:
  list_selector:
    row: "div.pageList li, ul.list3 li, ul.news_list li, .newsList li"
    href: "a::attr(href)"
    title: "a::attr(title), a::text"
    date: "span.date::text, span::text"
  pagination:
    type: path_pattern
    pattern: "index_{page}.html"
    start: 2
    max_pages: 30
  detail:
    title: >-
      h1.article-title::text, h1.title::text, h1::text,
      div.article-title::text, div.title::text
    publish_time: >-
      span.date b::text, div.article-attr span.date::text,
      div.info span.date::text, span.date::text, span.time::text,
      div.author e::text, em.time::text
    source: >-
      span.ly b::text, span.source::text, div.info em::text,
      div.article-attr span.ly::text
    content: >-
      div.article-content, div.content, div.TRS_Editor, div.article
    attachment_css: >-
      a[href$='.pdf'], a[href$='.doc'], a[href$='.docx'],
      a[href$='.xls'], a[href$='.xlsx'], a[href$='.zip'], a[href$='.wps'],
      a.nfw-cms-attachment, a[href*='/attachment/']

columns: []
