$("#loadmore_btn").click()
او
setInterval(function(){
$("#loadmore_btn").click()
},1000);
الأول يضغط مرة واحدة فقط، أم الثاني يعمل بشكل جيد.. شكرا لك ^^
طلب آخر: هل يوجد كود تلج به جميع المواضيع الموجودة في حساب معين :D
جرب
var getlength = setInterval(function(){
if($("#more_content").css("display") != "none"){
$("#loadmore_btn").click();
}else{
alert("عدد مواضيع العضو هي: " + $(".listItem").length);
clearInterval(getlength);
}
},1000);
اذا كنت تريده ان يفتح جميع مواضيع العضو في tap مستقل فاستخدم الكود التالي
var getlength = setInterval(function(){
if(document.querySelector("#more_content").style.display != "none"){
document.querySelector("#loadmore_btn").click();
}else{
document.querySelectorAll(".listItem").forEach(function(el,index){
let ele = el;
setTimeout(()=>{
window.open(ele.querySelector(".post-title a").href,"_blank")
},500 * index)
});
clearInterval(getlength);
}
},1000);
تأكد بإنك سامح لحسوب I/O بفتح صفحات منبثقة من المتصفحة
شكرا لك الكود يعمل جيدا، لكن يبدو أن الطريقة اليدوية أفضل فعندما تكون المساهمة على شكل رابط لا يجل إلى النقاش والتعليقات بل إلى الرابط مباشرة :(
جرب هذا اذًا
var getlength = setInterval(function(){
if(document.querySelector("#more_content").style.display != "none"){
document.querySelector("#loadmore_btn").click();
}else{
document.querySelectorAll(".listItem").forEach(function(el,index){
let ele = el;
setTimeout(()=>{
window.open(ele.querySelector(".commentsCounter a").href,"_blank")
},500 * index)
});
clearInterval(getlength);
}
},1000);
Uncaught TypeError: Cannot read property 'style' of null
at <anonymous>:2:47
هذه الرسالة التي ظهرت في console
هذا هو الحل
var getlength = setInterval(function(){
if(document.querySelector("#more_content") && document.querySelector("#more_content").style.display != "none"){
document.querySelector("#loadmore_btn").click();
}else{
document.querySelectorAll(".listItem").forEach(function(el,index){
let ele = el;
setTimeout(()=>{
window.open(ele.querySelector(".commentsCounter a").href,"_blank")
},500 * index)
});
clearInterval(getlength);
}
},1000);
إن كنت تقصد الخلاصة:
التعليقات