import crawl_jingmen_jtysj as c

# Test list page
recs = c.parse_list_page(c.BASE_URL + "/col/col3078/index.html")
print("List page: {} records".format(len(recs)))
for url, title, date in recs[:3]:
    print("  {} {}... -> {}".format(date, title[:50], url))
print()

# Test AJAX page 2
recs2 = c.parse_ajax_page(2)
print("AJAX page 2: {} records".format(len(recs2)))
for url, title, date in recs2[:3]:
    print("  {} {}... -> {}".format(date, title[:50], url))
print()

# Test detail
t, d, s, html = c.parse_detail(recs[0][0])
print("Detail: title=[{}] date=[{}] source=[{}] content_len=[{}]".format(t, d, s, len(html)))
print("Content sample:", html[:300])
