Skip to content

Commit

Permalink
fix parse_search_result
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Apr 12, 2024
1 parent 84956b8 commit 327d956
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion novel.ja-JP/AlphaPolis.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,26 @@ var crawler = CeL.AlphaPolis({

// 解析 作品名稱 → 作品id get_work()
parse_search_result : function(html, get_label) {
// console.trace(html);
var id_data = [],
// {Array}id_list = [id,id,...]
id_list = [];
html.each_between('<h2 class="title">', '</h2>', function(text) {
id_list.push(text.between(' href="/novel/', '"')
/**
* <code>
<a href="https://www.alphapolis.co.jp/novel/904773584/638380930" target="_blank" class="">余りモノ異世界人の自由生活~勇者じゃないので勝手にやらせてもらいます~</a>
</code>
*/
// console.trace(text);
id_list.push(text.between('/novel/', '"')
//
.replace('/', '-'));
// get <a>.innerText
id_data.push(get_label(text.between('>', '<')));
});
// console.trace([ id_list, id_data ]);
return [ id_list, id_data ];
},

Expand Down

0 comments on commit 327d956

Please sign in to comment.