Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

open a web page using selenium python

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome('./chromedriver')
driver.get("https://www.python.org")
print(driver.title)
search_bar = driver.find_element_by_name("q")
search_bar.clear()
search_bar.send_keys("getting started with python")
search_bar.send_keys(Keys.RETURN)
print(driver.current_url)
driver.close()
Comment

how to open a website with selenium python

from selenium import webdriver

PATH = 'Path to web browser driver...'
driver = webdriver.Chrome(PATH) # Selenium also supports edge and firefox
driver.get("url to website")
Comment

PREVIOUS NEXT
Code Example
Python :: get object attributes python 
Python :: django secret key 
Python :: print key of dictionary python 
Python :: pca python 
Python :: python paramiko check ssh connection 
Python :: how to accept input as list pyhton 
Python :: call parent function init python 
Python :: python datetime minus days 
Python :: .get python 
Python :: django import models 
Python :: Unable to locate package python3.6-venv 
Python :: set seed python 
Python :: how to open cmd at specific location usng python 
Python :: wait for input python 
Python :: python dict to url params 
Python :: change axis and axis label color matplotlib 
Python :: pip install contractions 
Python :: use sqlalchemy to create sqlite3 database 
Python :: $ sudo pip install pdml2flow-frame-inter-arrival-time 
Python :: SerialClient.py", line 41, in <module import queue ImportError: No module named queue 
Python :: remove every file that ends with extension in python 
Python :: how to openn file dialog in tkinter 
Python :: virtual env in mac 
Python :: make python file executable linux 
Python :: neural network without training return same output with random weight 
Python :: python collections counter 
Python :: datetime.timedelta months 
Python :: python import upper directory 
Python :: python twilio certificate error 
Python :: venv upgrade python 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =