Advertisement
Bonisek

honziki_scrapi_dvojki

Mar 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import requests
  2.  
  3. from bs4 import BeautifulSoup
  4.  
  5.  
  6. def get_data():
  7.     url_to_scrape = 'http://www.in-pocasi.cz/archiv/archiv.php?historie=27-03-2017&klima_kraj=4&stanice_kraj=4#amaterske'
  8.     r = requests.get(url_to_scrape)
  9.     soup = BeautifulSoup(r.text, "html.parser")
  10.     tables = soup.find_all('table')
  11.  
  12.     for table in tables:
  13.         rows = table.find_all('tr')
  14.         for row in rows:
  15.             print(row.text)
  16.  
  17.  
  18. def main():
  19.     get_data()
  20.  
  21. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement