Chromedriver launch new tab - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Chromedriver launch new tab (/thread-16009.html) Pages:
1
2
|
RE: Chromedriver launch new tab - metulburr - Feb-16-2019 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.
RE: Chromedriver launch new tab - gahhon - Feb-16-2019 (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 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.yahooSo 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. RE: Chromedriver launch new tab - gahhon - Feb-16-2019 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) RE: Chromedriver launch new tab - metulburr - Feb-17-2019 you can build your python scripts to exe also https://python-forum.io/Thread-Building-an-exe-with-Py2exe RE: Chromedriver launch new tab - gahhon - Feb-17-2019 (Feb-17-2019, 12:04 AM)metulburr Wrote: you can build your python scripts to exe also 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 RE: Chromedriver launch new tab - metulburr - Feb-17-2019 thats a separate issue then, not really related to issues with chromedriver (the title of this thread) |