Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

selenium python tkinter

import tkinter as tk
import selenium.webdriver

# --- functions ---

def on_open():
    global driver

    if not driver:
        driver = selenium.webdriver.Firefox()
        url = e.get()
        driver.get(url)

def on_close():
    global driver

    if driver:
        driver.close()
        driver = None

# --- main ---

driver = None

root  = tk.Tk()

e = tk.Entry(root)
e.pack()
e.insert('end', 'https://stackoverflow.com')

b = tk.Button(root, text='Selenium Open', command=on_open)
b.pack()

b = tk.Button(root, text='Selenium Close', command=on_close)
b.pack()

root.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: creating methods in python 
Python :: django.db.utils.IntegrityError: 
Python :: try for loop python 
Python :: dicionario python 
Python :: {% load humanise %} 
Python :: run python script inside bash script 
Python :: Create list of unique values from dictionary 
Python :: return position of a unique value in python array 
Python :: python strptime milliseconds 
Python :: get lastest files from directory python 
Python :: prevent selenium from closing 
Python :: python map list of int to string 
Python :: sequence with numbers in python 
Python :: qpushbutton clicked 
Python :: how to replace a string in py 
Python :: Django Abstract base classe 
Python :: Math Module exp() Function in python 
Python :: group by dataframe 
Python :: lose your django secret key 
Python :: count number of element in list 
Python :: pandas frequency 
Python :: django add to database 
Python :: how to change order of attributes of an element using beautiful soup 
Python :: rename colonne pandas 
Python :: saving model 
Python :: how to change padding of dbc.col 
Python :: change gles3 to gles2 
Python :: pytorch dataloader to device 
Python :: unlimited arguments 
Python :: get processor model in python 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =