Created
March 17, 2021 20:52
-
-
Save SeanFelipe/a2e779addadddb3910ede57ef91b1091 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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