百度文库复制文字代码
生活随笔
收集整理的這篇文章主要介紹了
百度文库复制文字代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先在控制臺執行:
var importJs=document.createElement('script')//在頁面新建一個script標簽 importJs.setAttribute("type","text/javascript")//給script標簽增加type屬性 importJs.setAttribute("src", 'https://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js') //給script標簽增加src屬性, url地址為cdn公共庫里的 document.getElementsByTagName("head")[0].appendChild(importJs)//把importJs標簽添加在頁面然后執行:
let pageSizeStr = prompt('please input the pageSize', 1); // 輸入文檔的頁數,自行測試 let pageSize = parseInt(pageSizeStr); let text = ''; for (let i = 0; i < pageSize; i++) {let result = jQuery(jQuery('.ie-fix')[i]).text();text += result; } text; console.log(text);總結
以上是生活随笔為你收集整理的百度文库复制文字代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 谷歌电子市场[Google Play]发
- 下一篇: 如何在百度文库复制文字