Jump to content
UBot Underground

[Exbrowser] Chrome Load Profile Multithreading


Recommended Posts

Hello,

 

I have tried to use the exbrowser loading several profile with multithreading and do not seem to work.

The browsers are launched, but all threads are working inside the first browser only.

Is this function abble to be multithread?

Regards

Link to post
Share on other sites

Hello,

 

I have tried to use the exbrowser loading several profile with multithreading and do not seem to work.

The browsers are launched, but all threads are working inside the first browser only.

Is this function abble to be multithread?

Regards

 

Hi.

Yes it's possible.

 

1. Profiles need to be separated. Each thread needs it's own profile directory (Chome)

2. You need to be aware of thread IDs, And your commands need to be executed in the right thread context. This can be a bit tricky to understand when you use threads first time with ubot. 

But there are some free examples and training available in the forum and from some other members.

 

If you post your code (simple version please), we can probably take a look and guide you. But don't post 100 lines of code :-)

 

Cheers

Dan

  • Like 1
Link to post
Share on other sites

Thank you for your reply Teacher.

I think the multithread is working, but not in the way i would like.

I do not want to multithread different profiles.

I just need to multithread 5 chrome browser with the same profile but opening different urls.

The result i have is opening 5 browser but only 1 browser seems to make the threads.

If EB could open tab and in thread and execute the thread code for this tab, may be i can avoid opening multiple browsers?

I will try to post a resume code to show it.

Thanks a lot

Edited by kill3rbko
  • Like 1
Link to post
Share on other sites

Hello Mastas, here is resumed code i am using.

I confirm that without loading profile in EB this code is working very well.

My objective with the profile was to use inside a vpn addon set to specific country, then login with the specific account and surf ads.

Each account would have a chrome profile "country".

In the below code i did not make yet the loop for changing profile, i just need to open multiple browser with the same profile in threads.

loop($list total(%Jobs)) {
    set(#threadcounter,0,"Global")
    Login()
    set(#Finished,"false","Global")
    loop while($comparison(#Finished,"= Equals","false")) {
        plugin command("ExBrowser.dll", "ExBrowser CleanUp", "No")
        wait(1)
        set(#log,"Opening browser...","Global")
        plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "{$plugin function("ExBrowser.dll", "$ExBrowser Specify Binary Location", "{$special folder("Application")}\\Chrome\\chrome.exe")}{$plugin function("ExBrowser.dll", "$ExBrowser Position Window", 800, 0)}{$plugin function("ExBrowser.dll", "$ExBrowser Window Size", 800, 600)}{$plugin function("ExBrowser.dll", "$ExBrowser Load Chrome Profile", "{$special folder("Application")}\\Profile.{#country}")}")
        set(#log,"Loading Ads page...","Global")
        wait(5)
        plugin command("ExBrowser.dll", "ExBrowser Navigate", "http://www.myadsiteurl.fr/ptc.php")
        plugin command("ExBrowser.dll", "ExBrowser Load Cookies", "{$special folder("Application")}\\cookies.txt")
        wait(0.5)
        plugin command("ExBrowser.dll", "ExBrowser Navigate", "http://www.myadsiteurl.fr/ptc.php")
        set(#Balance,$plugin function("ExBrowser.dll", "$ExBrowser Scrape Element", "//*[@id=\"content\"]/div/div[2]/div[1]/div[2]/h3[1]"),"Global")
        set(#i,0,"Global")
        clear list(%Ads)
        add list to list(%Ads,$plugin function("ExBrowser.dll", "$ExBrowser Scrape List Elements Attribute", "//a[contains(@href,\"visite.php?id_campagne=\")]", "href"),"Delete","Global")
        set list position(%Ads,0)
        set(#Total,$list total(%Ads),"Global")
        set(#log,"Total ads : {#Total}","Global")
        set(#threadcounter,0,"Global")
        if($comparison(#Total,"> Greater than",0)) {
            then {
                set(#EndAds,"false","Global")
                set(#Finished,"false","Global")
                increment(#nloop)
                if($comparison(#nloop,"> Greater than",4)) {
                    then {
                        set(#Finished,"true","Global")
                    }
                    else {
                    }
                }
            }
            else {
                set(#EndAds,"true","Global")
                set(#Finished,"true","Global")
            }
        }
        set(#j,0,"Global")
        if($comparison(#Finished,"= Equals","false")) {
            then {
                plugin command("ExBrowser.dll", "ExBrowser Close")
            }
            else {
            }
        }
        loop while($comparison(#EndAds,"= Equals","false")) {
            loop while($comparison(#threadcounter,">= Greater than or equal to",#Thread)) {
                wait(2)
            }
            increment(#threadcounter)
            increment(#i)
            increment(#j)
            set(#log,"Viewing Ad {#i} / {#Total} ...","Global")
            set(#log1,"Loading Page {#i}...","Global")
            set(#MyUrl,$next list item(%Ads),"Global")
            SurfAds(#MyUrl)
            wait(1)
            
            
        }
    }
    set(#log1,"Job {#Job} finished !","Global")
    set(#log2,"","Global")
}
plugin command("ExBrowser.dll", "ExBrowser CleanUp", "No")

Now Surfad code :

define SurfAds(#MyAd) {
    thread {
        plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "{$plugin function("ExBrowser.dll", "$ExBrowser Specify Binary Location", "{$special folder("Application")}\\Chrome\\chrome.exe")}{$plugin function("ExBrowser.dll", "$ExBrowser Position Window", 800, 0)}{$plugin function("ExBrowser.dll", "$ExBrowser Window Size", 800, 600)}{$plugin function("ExBrowser.dll", "$ExBrowser Load Chrome Profile", "{$special folder("Application")}\\Profile.{#country}")}")
        wait(0.5)
        plugin command("ExBrowser.dll", "ExBrowser Navigate", #MyAd)
        set(#credit,"false","Local")
        if($contains(#MyAd,"id_campagne=6&")) {
            then {
                set(#id,"id=6","Global")
                set(#credit,"true","Global")
                set(#log2,"id=6 Waiting 15 s...","Global")
                wait(15)
            }
            else {
            }
        }
        if($contains(#MyAd,"id_campagne=7&")) {
            then {
                set(#id,"id=7","Global")
                set(#credit,"true","Global")
                set(#log2,"id=7 Waiting 15 s...","Global")
                wait(15)
            }
            else {
            }
        }
         // lot of loop like previous one here
        
        if($comparison(#credit,"= Equals","false")) {
            then {
                set(#id,"id=???","Global")
                set(#credit,"true","Global")
                set(#log2,"id=? Waiting 40 s...","Global")
                wait(40)
            }
            else {
            }
        }
        set(#log2,"Closing {#id}","Global")
        decrement(#threadcounter)
        plugin command("ExBrowser.dll", "ExBrowser Close")
    }
}
Link to post
Share on other sites

Every instance of Chrome needs it's own profile. Otherwise it doesn't work. Chrome can't load the same profile from multiple browsers. 

Give that a try and see if that works better then.

 

Dan

  • Like 2
Link to post
Share on other sites

Every instance of Chrome needs it's own profile. Otherwise it doesn't work. Chrome can't load the same profile from multiple browsers. 

Give that a try and see if that works better then.

 

Dan

OMG, i got you now lol.

Even if i use the same copy of the profile it should work?

Let me try it!

Thanks

  • Like 1
Link to post
Share on other sites

OMG, i got you now lol.

Even if i use the same copy of the profile it should work?

Let me try it!

Thanks

 

Please, if this help you, write here! I had similar problems.

Link to post
Share on other sites

OMG, i got you now lol.

Even if i use the same copy of the profile it should work?

Let me try it!

Thanks

Yes you can copy it, It's just that the files are locked from the windows operating system because the chrome process accesses it. Then another process can't access the same files for read/write access.

Dan

  • Like 2
Link to post
Share on other sites

Great will try it tonight.

By the way i have made 10 copy of the profile's folder each one is 160 Mb.

I s there any way to keep the just necessary files for the profile? i am just using 2 vpn extensions inside.

Thanks in advance Dan

Edited by kill3rbko
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...