File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 44from selenium .webdriver import ActionChains
55
66
7- driver = webdriver .PhantomJS (executable_path = 'phantomjs/bin/phantomjs' )
7+ #REPLACE WITH YOUR DRIVER PATH. EXAMPLES FOR CHROME AND PHANTOMJS
8+ driver = webdriver .PhantomJS (executable_path = '../phantomjs-2.1.1-macosx/bin/phantomjs' )
9+ #driver = webdriver.Chrome(executable_path='../chromedriver/chromedriver')
810driver .get ("http://pythonscraping.com/pages/files/form.html" )
911
1012firstnameField = driver .find_element_by_name ("firstname" )
Original file line number Diff line number Diff line change 22from selenium .webdriver .remote .webelement import WebElement
33from selenium .webdriver import ActionChains
44
5- driver = webdriver .PhantomJS (executable_path = 'phantomjs/bin/phantomjs' )
5+ #REPLACE WITH YOUR DRIVER PATH. EXAMPLES FOR CHROME AND PHANTOMJS
6+ driver = webdriver .PhantomJS (executable_path = '../phantomjs-2.1.1-macosx/bin/phantomjs' )
7+ #driver = webdriver.Chrome(executable_path='../chromedriver/chromedriver')
8+
69driver .get ('http://pythonscraping.com/pages/javascript/draggableDemo.html' )
710
811print (driver .find_element_by_id ("message" ).text )
Original file line number Diff line number Diff line change 33from selenium .webdriver import ActionChains
44
55
6- driver = webdriver .PhantomJS (executable_path = '<Path to Phantom JS>' )
6+ #REPLACE WITH YOUR DRIVER PATH. EXAMPLES FOR CHROME AND PHANTOMJS
7+ driver = webdriver .PhantomJS (executable_path = '../phantomjs-2.1.1-macosx/bin/phantomjs' )
8+ #driver = webdriver.Chrome(executable_path='../chromedriver/chromedriver')
9+
710driver .implicitly_wait (5 )
811driver .get ('http://www.pythonscraping.com/' )
912driver .get_screenshot_as_file ('tmp/pythonscraping.png' )
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ class TestAddition(unittest.TestCase):
77 driver = None
88 def setUp (self ):
99 global driver
10- driver = webdriver .PhantomJS (executable_path = '<Path to Phantom JS>' )
10+ #REPLACE WITH YOUR DRIVER PATH. EXAMPLES FOR CHROME AND PHANTOMJS
11+ driver = webdriver .PhantomJS (executable_path = '../phantomjs-2.1.1-macosx/bin/phantomjs' )
12+ #driver = webdriver.Chrome(executable_path='../chromedriver/chromedriver')
1113 url = 'http://pythonscraping.com/pages/javascript/draggableDemo.html'
1214 driver .get (url )
1315
You can’t perform that action at this time.
0 commit comments