Advertisement
borsha06

Untitled

Feb 24th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1.  
  2. import requests
  3. from bs4 import BeautifulSoup
  4. def get_code(url):
  5.     req=requests.get(url)
  6.     code=req.text
  7.     return code
  8.  
  9.    
  10. def bs4_get(content):
  11.     soup=BeautifulSoup(content,"html.parser")
  12.     get_all=soup.find_all("tbody")
  13.     return get_all
  14.    
  15.  
  16. def atcoder():
  17.     url=url="https://atcoder.jp/"  
  18.     texts=get_code(url)
  19.     all_text=bs4_get(texts)
  20.     """start=all_text.index("Upcoming Contests")
  21.    end=all_text.index("AtCoder Regular Contest 070"+1)
  22.    all_text=all_text[start:end]"""
  23.     print (all_text)
  24.    
  25. atcoder()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement