Skip to content

Instantly share code, notes, and snippets.

@SeanFelipe

SeanFelipe/proto.py

Created Mar 17, 2021
Embed
What would you like to do?
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from pyte_prism import Page, Element, Elements
from pdb import set_trace
#from pyte_prism import PageSection, PageIframe, Element, Section, Sections, Iframe
# Page must inherit Page class
class GoogleHome(Page):
_url = "http://google.com/"
# definition of element
inp = Element(By.XPATH, "//input[@name='q']")
sub = Element(By.XPATH, "//input[@type='submit']")
gsearch = Element(By.XPATH, "//input[@value='Google Search']")
s2 = Elements(By.XPATH, "//input[@type='submit']")
#def main():
driver = webdriver.Chrome()
home = GoogleHome(driver)
home.load()
home.inp.send_keys("foobar")
set_trace()
home.gsearch.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment