We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果豆瓣有些出版年或者出版社等信息没有的话就会出现undefined错误,导致不能同步到notion当中,可以将getBookInfo的函数修改一下即可
function getBookInfo(){ let infos = document.getElementById("info").getElementsByClassName("pl"); var book = {}; book["title"] = document.getElementsByTagName("h1")[0].getElementsByTagName("span")[0].innerText; book["封面"] = document.getElementsByClassName("nbg")[0].href; book["评分"] = document.getElementsByClassName("rating_num")[0].innerText; for(let info of infos) { if(info.innerText === "作者") { book["作者"] = info.nextSibling.nextSibling.innerText } else if(info.innerText === "出版社:") { if(info.nextSibling.nextSibling.innerText == ""){ book["出版社"] =info.nextSibling.textContent }else{ book["出版社"] = info.nextSibling.nextSibling.innerText } } else { prop = info.innerText.substr(0,info.innerText.length-1) book[prop] = info.nextSibling.data } } var preInfos = ["作者","评分","出版社","出版年","页数","ISBN"] for(let info of preInfos){ if(book[info]==undefined){ book[info]="" } } return book }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果豆瓣有些出版年或者出版社等信息没有的话就会出现undefined错误,导致不能同步到notion当中,可以将getBookInfo的函数修改一下即可
The text was updated successfully, but these errors were encountered: