mirror of
https://github.com/webxoss/wixoss-fetch.git
synced 2024-11-20 05:49:55 +01:00
Robustness of illust
This commit is contained in:
parent
eeeb72b6cd
commit
36a97064d3
3 changed files with 55 additions and 53 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -461,7 +461,8 @@ function toInfo(doc, id) {
|
||||||
|
|
||||||
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
|
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
|
||||||
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
|
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
|
||||||
info.illust = doc.querySelector('.card_img').textContent.match(/Illust (.*)$/)[1]
|
info.illust = (doc.querySelector('.card_img').textContent.match(/Illust (.*)$/) || [])[1] || ''
|
||||||
|
if (!info.illust) console.warn(`${info.pid}: no illust!`)
|
||||||
|
|
||||||
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)
|
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)
|
||||||
|
|
||||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -92,7 +92,8 @@ function toInfo(doc, id) {
|
||||||
|
|
||||||
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
|
// info.imgUrl = domain + doc.querySelector('.card_img > img').getAttribute('src')
|
||||||
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
|
info.imgUrl = doc.querySelector('.card_img > img').getAttribute('src')
|
||||||
info.illust = doc.querySelector('.card_img').textContent.match(/Illust (.*)$/)[1]
|
info.illust = (doc.querySelector('.card_img').textContent.match(/Illust (.*)$/) || [])[1] || ''
|
||||||
|
if (!info.illust) console.warn(`${info.pid}: no illust!`)
|
||||||
|
|
||||||
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)
|
info.faqs = toArr(doc.querySelectorAll('.card_FAQ > p')).map(toFaq)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue