Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Mario Lopes
Added: Feb 18, 2018 4:14 PM
Views: 59
Acess website com selenium
  1. from selenium import webdriver
  2. from bs4 import BeautifulSoup
  3. import time
  4. from urllib.request import urlopen
  5. browser = webdriver.Firefox()
  6. url = 'http://localhost:64273/login.aspx'
  7. browser.get(url)
  8. user_name = browser.find_element_by_name('txtUser')
  9. user_name.send_keys("mario")
  10. passe=browser.find_element_by_name('txtPasse')
  11. passe.send_keys("lopes")
  12. submit = browser.find_elements_by_name('Button1')
  13. submit[0].click()
  14. time.sleep(2)
  15. browser.quit()