Python Forum
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.
Recommended Tutorials:
Reply
#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.
Reply
#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?
Reply
#14
you can build your python scripts to exe also
https://python-forum.io/Thread-Building-...ith-Py2exe
Recommended Tutorials:
Reply
#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
Reply
#16
thats a separate issue then, not really related to issues with chromedriver (the title of this thread)
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium undetected Chromedriver Bot Laurin0000 1 3,966 Apr-13-2023, 09:20 PM
Last Post: Clixmaster
  enable flash using selenium chromedriver Fre3k 1 4,248 Nov-27-2020, 12:15 PM
Last Post: JellyCreeper6
  WebDriverException: 'chromedriver' executable needs to be in PATH pyzyx3qwerty 9 12,638 Jun-09-2020, 05:43 PM
Last Post: Yoriz
  Selenium Chromedriver Automation Help lessthanthree 1 2,115 May-05-2020, 11:03 PM
Last Post: Larz60+
  How to identify chromedriver version? metulburr 2 7,459 Jun-13-2019, 11:37 PM
Last Post: metulburr
  chromedriver.exe issue gahhon 2 2,766 Feb-12-2019, 12:09 PM
Last Post: metulburr
  Selenium chromedriver and click action Gilles95 4 13,198 Feb-07-2018, 07:28 PM
Last Post: Gilles95

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020