PTT-Crawler:专用于PTT网站的网络爬虫

时间:2021-04-30 19:32:04
【文件属性】:
文件名称:PTT-Crawler:专用于PTT网站的网络爬虫
文件大小:6KB
文件格式:ZIP
更新时间:2021-04-30 19:32:04
ptt ptt-crawler Python PTT Crawler 一个练习网路爬虫的小实验,可以取出PTT 文章中标题、内容与推文。 使用方式 批量爬取 crawler = PttCrawler () crawler . crawl ( board = "欲爬取的看版名稱" , start = StartIndex , end = EndIndex ) start表示想从哪一页开始爬取, end则是爬到哪一页时会停止,比方说想爬取八卦版的90 ~ 100页,可以设定为: crawler . crawl ( board = "Gossiping" , start = 90 , end = 101 ) 单一页面爬取 透过调用crawler.parse_article(url)可以爬取单一页面,回传值为包含文章资讯的dictionary crawler = PttCrawler () result = crawler . pars
【文件预览】:
PTT-Crawler-master
----Crawler.py(7KB)
----LICENSE(1KB)
----README.md(2KB)
----.gitignore(1KB)
----example.py(678B)

网友评论