Baidu searches for a keywords

opsfafsme

Well-Known Member
Rule The Universe
VIP
Joined
Jul 2, 2018
Messages
222
Reaction score
85
Website
OnlinePiercingShop.com
Achievement
hi guys, as requested by @randymp1993 changed the macro for baidu, but I'm not sure if it works correctly due to the presence of hieroglyphs
Variables
plugDomain
- is the site that will be loaded if your site is not found by keywords
myDomain - your site, can be written in hieroglyphs

JavaScript:
await Delay(Random(2500,3000));
await WaitForLoading();
var page, scrl, random_keyword, tabs, temp;

var clicks = Random(3,5);
var max_page = Random(3,5);
var myDomain = "space.com";
var plugDomain = "imdb.com";
var keywords = [
    "Matt Damon",
    "MAtt damon imdb",
    "matt DAMON biography",
    "matt damon wife"
    ];

    if ( await EvaluateScript("!! document.querySelector('input.s_ipt')") ) {
        await ClickById("kw");
    } else if ( await EvaluateScript("!! document.querySelector('input.se-input.adjust-input')") ) {
        await ClickById("index-kw");
    } else {
        Exit();
    }

    await Delay(Random(2500,3000));
    random_keyword = Math.floor(Math.random() * keywords.length);
    await Typing (keywords[random_keyword], 300, 500);
    await Delay(Random(500,1000));
    await Typing ("\r\n");
    await Delay(Random(2500,3000));
    await WaitForLoading();

    page = 1;
    do {
        do { //scroll
            scrl = Random(3,9);
            for (var i = 1; i < scrl; i++) {
                await EvaluateScript("var ddE = document.documentElement; ddE.scrollTo(0, ddE.clientHeight/(Math.floor(Math.random()*3)+9) + ddE.scrollTop);");
                await Delay(Random(100,150));
            }
            await Delay (Random(1000,1500));
        } while (await EvaluateScript("var ddE = document.documentElement; ddE.clientHeight+ddE.scrollTop < ddE.scrollHeight"))
        myTargetXpath = GenerateXpath("a", "text", "%" + myDomain + "%");
        foundLink = await GetAttribute(myTargetXpath, "href");
        if ( foundLink ) {
            await ClickByXpath(myTargetXpath);
            break;
        } else if (page < max_page) {
            if ( await EvaluateScript("!! document.querySelector('a.n')") ) {
                if (page>1) {
                    await ClickByXpath(GenerateXpath("a", "class", "n", 2));
                } else {
                    await ClickByXpath(GenerateXpath("a", "class", "n"));
                }
            } else if (await EvaluateScript("!! document.querySelector('a.new-nextpage-only')")) {
                await ClickByXpath(GenerateXpath("a", "class", "new-nextpage-only"));
            } else if (await EvaluateScript("!! document.querySelector('a.new-nextpage')")) {
                await ClickByXpath(GenerateXpath("a", "class", "new-nextpage"));
            } else {
                Exit();
            }
            await Delay(Random(2500,3000));
            await WaitForLoading();
        } else {
            await EvaluateScript("window.open('https://" + plugDomain + "','_self')");
        }
        page = page+1;
    } while (page <= max_page)

    do {
        await Delay(Random(2500,3000));
        await WaitForLoading();
        tabs = await TabCount();
        if (tabs > 1) {
        await TabFocus(tabs);       
        }
        do { //scroll
            scrl = Random(3,9);
            for (var i = 1; i < scrl; i++) {
                await EvaluateScript("var ddE = document.documentElement; ddE.scrollTo(0, ddE.clientHeight/(Math.floor(Math.random()*3)+9) + ddE.scrollTop);");
                await Delay(Random(100,150));
            }
            await Delay (Random(1000,1500));
        } while (await EvaluateScript("var ddE = document.documentElement; ddE.clientHeight+ddE.scrollTop < ddE.scrollHeight"))
        await Delay(Random(5000,7000));
        await ClickRandomInternalLink(true);
    } while (--clicks)
    await Delay(Random(5000,7000));
    await WaitForLoading();
Exit();
 
  • Like
Reactions: serjojazz

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu