Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Chromedriver launch new tab
#11
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.
Quote
#12
Information 
(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

>> 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.
Quote
#13
Anyway, I have the solution for the software to send line by line to CMD window to trigger particular functions.
Now final concern is
Quote: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?
Quote
#14
you can build your python scripts to exe also
https://python-forum.io/Thread-Building-...ith-Py2exe
Quote
#15
(Feb-17-2019, 12:04 AM)metulburr Wrote: you can build your python scripts to exe also
https://python-forum.io/Thread-Building-...ith-Py2exe

I had tried to convert the script to executable file, but it just unable to execute the .exe file.
I had post in the forum but no one response.
Fail to execute .exe file
Quote
#16
thats a separate issue then, not really related to issues with chromedriver (the title of this thread)
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  WebDriverException: 'chromedriver' executable needs to be in PATH pyzyx3qwerty 9 344 Jun-09-2020, 05:43 PM
Last Post: Yoriz
  Selenium Chromedriver Automation Help lessthanthree 1 556 May-05-2020, 11:03 PM
Last Post: Larz60+
  enable flash using selenium chromedriver Fre3k 0 847 Feb-01-2020, 11:05 AM
Last Post: Fre3k
  How to identify chromedriver version? metulburr 2 510 Jun-13-2019, 11:37 PM
Last Post: metulburr
  chromedriver.exe issue gahhon 2 691 Feb-12-2019, 12:09 PM
Last Post: metulburr
  Selenium chromedriver and click action Gilles95 4 8,343 Feb-07-2018, 07:28 PM
Last Post: Gilles95

Forum Jump:


Users browsing this thread: 1 Guest(s)