Advertisement
Guest User

Untitled

a guest
Jun 27th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import request
  2. import bs4
  3. import lxml
  4.  
  5.  
  6. def get_answer():
  7. ''' Function for getting count of vowels in url and posts answer '''
  8.  
  9. # in this block we're getting the raw text
  10. r = requests.get('https://ctf.zsis.hr/login?username=####&password=#####')
  11. soup = bs4.BeautifulSoup(r.text, 'lxml')
  12. rawtext = soup.find_all('pre')
  13.  
  14. # we have to strip rawtext before we loop through it
  15. answer = 0
  16. for sym in rawtext:
  17. if sym in 'aeyoui':
  18. answer += 1
  19. return answer
  20.  
  21. # this is line with posted answer
  22. requests.post('https://ctf.zsis.hr/', answer)
  23.  
  24. get_answer()
  25.  
  26.  
  27.  
  28. # 72-5432
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement