Guest User

Untitled

a guest
Nov 13th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import requests
  2. import bs4 as bs
  3.  
  4. login_url = "__withheld__"
  5. target_url = "__withheld__"
  6.  
  7. login_data = { "username": "my_username", "password": "my_password"}
  8.  
  9. with requests.Session() as s:
  10. page = s.get(login_url)
  11. page_login = s.post(login_url, data = login_data)
  12. page = s.get(target_url)
  13. final_page = bs.BeautifulSoup(page.content, 'lxml')
  14. print(final_page.title)
  15.  
  16. <input name="username" type="text" id="username" class="metro-input" placeholder="Username" value="">
  17. <span id="username-error" class=""></span>
  18. <label class="ie789Only"> Password</label>
  19. <input name="password" type="password" id="password" class="metro-input" placeholder="Password">
  20. <input type="submit" name="button1" value="Sign in" id="button1" class="metro-button">
  21.  
  22. import requests
  23. import bs4 as bs
  24. username = 'username of the site'
  25. password = 'password of the site'
  26.  
  27. req = requests.get(login_url, auth=(username, password))
  28. final_page = bs.BeautifulSoup(req.content, 'lxml')
  29. print(final_page.title)
Add Comment
Please, Sign In to add comment