(Feb-16-2019, 01:39 PM)metulburr Wrote: The way you have it coded in your first post you are creating separate processes for every time you hit a button. So for example you keep hitting yahoo and it creates an entire different browser every time. You are going to want to unite them. The best way to do that is a class. This driver = webdriver.Chrome(executable_path=r'chromedriver.exe')
being in every function creates a new driver process every time.
Any sample code to achieve this?
I apologies that I am new to python. :x
EDIT:
Now I had follow your advised. I combined them into 1 python script file.
And execute them via CMD function by function like
1 2 3 4 5 |
>> python
>> import sample
>> sample.google
>> sample.baidu
>> sample.yahoo
|
So these will import the python script and execute function by function, each function will open in new tab and redirect to desire URL.
But somehow, I am finding solution for my another software that designed the GUI, on how to send multiple line of command without open new CMD.
Anyway, I wanna ask if the python script has convert to executable file (sample.py >> sample.exe)
It is possible to execute the sample.exe function by function via CMD, like the CMD shown above?
If can't, then is there anyway to protect my python script similar like executable file?
Thanks.