Fetch the repository succeeded.
This action will force synchronization from 烈冰/go_sexy, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
Go语言实现妹子图爬虫
纯粹是一个练手的项目,里面用到很多Go的特性,例如goroutine、channel、自定义类型、错误处理等等
放上来给大家参考一下,我也是初学golang,有哪些地方写得不好请指正
{
"root":"xxxxxx.com",
"proxy":{
"server":"127.0.0.1:1080", /*SOCKS5代理服务器,如果设置成空字符串则不使用代理 127.0.0.1:1080*/
"username":"",
"password":""
},
"header":{/*http请求头*/
"Host":"xxxxxx.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
"Referer": "http://xxxxxx.com/zaqizaba/2407.html"
},
"charset":"gbk", /*可选值utf-8或gbk*/
"regex":{
"page":[], /*正则表达式,只有符合的页面才会被抓取并解析,空白表示所有页面都抓取*/
"imgInPage":["\S+\d+\.html"], /*存放正则,指定图片存在于哪些页面*/
"href":[ /*匹配页面上的链接*/
{
"query":"a", /*存放链接的dom选择器*/
"attr":"href"
}
],
"image":[ /*匹配页面上的图片地址*/
{
"query":"article.article-content img", /*匹配图片的dom选择器*/
"attr":"src",
"folder":"none" /*存放图片的文件夹,可选值url,title,none,正则表达式,文件夹名称*/
}
]
}
}
配置文件使用json格式:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。