Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Chrome window control

So im having a issue im new to py so bear with me i dont know nearly enough sytax's here.

So im trying to window & tab control i was using java but chrome blocks being able to tab control them with java so that wont work.
End game is opening 4-5 different windows with each having about 3-5 tabs in each.
Each window is sized and positioned accordingly (preferably from a readline with such data
Quote:Chrome=C:\Chrome.exe
"http://www.twitter.com","Window1","width=350,height=250,left=700,top=700"
"http://www.facebook.com",Window1"

"http://www.twitter.com","Window2","width=350,height=250,left=250,top=250"
"http://www.facebook.com",Window2"



or something close to it

while diving in to py ive noticed it does not creat a call handle for the window so how do i control it to manipulate or add tabs?
webbrowser
webbrowser.open
allows me to open a new tab but no where can i designate the call handle for the window? how can i resize and position it and designate which window is getting which tab. (mind you i do not have selenium)

any help would be appreciated thanks
look at this. it should help to write your own script

Code
import subprocess
import sys

def main(argc, argv):
    windows = [
        ("www.google.com", "twitter.com"),
        ("facebook.com", "youtube.com")
    ]
    for links in windows:
        attach = ""
        for link in links:
            attach+= ' "' + link + '"'
        cmd = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window ' + attach
        subprocess.call(cmd)
    sys.exit(0)

if __name__ == '__main__':
    try:
        main(len(sys.argv), sys.argv)
    except KeyboardInterrupt:
        pass
(Aug 28, 2018 01:42 AM).kr. Wrote:  look at this. it should help to write your own script

Code
import subprocess
import sys

def main(argc, argv):
   windows = [
       ("www.google.com", "twitter.com"),
       ("facebook.com", "youtube.com")
   ]
   for links in windows:
       attach = ""
       for link in links:
           attach+= ' "' + link + '"'
       cmd = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window ' + attach
       subprocess.call(cmd)
   sys.exit(0)

if __name__ == '__main__':
   try:
       main(len(sys.argv), sys.argv)
   except KeyboardInterrupt:
       pass
🤗 🎉 👍
thanks, got it done


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by KyogoDec 4, 2017 10:07 PM 2 232 Dec 4, 2017 10:07 PM
Last Post: totenkopf
[C#] by ۤMD5Aug 31, 2015 05:52 AM 20 1,111 Aug 31, 2015 05:52 AM
Last Post: Mr Whiskey
[.NET] by WashiOct 8, 2014 08:18 AM 61 2,595 Oct 8, 2014 08:18 AM
Last Post: SIM-1456245