SHARE
TWEET

Untitled

a guest Jan 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from bs4 import BeautifulSoup
  2. import requests
  3.  
  4.  
  5. wiki = "http://www.ii.up.krakow.pl/consultations.html"
  6. req = requests.get(wiki)
  7. page = BeautifulSoup(req.content,'lxml')
  8.  
  9. table=  page.table
  10. table_rows = table.find_all('tr')
  11.  
  12. for e in page.select(".description"):
  13.     for tr in table_rows:
  14.         td = tr.find_all('td')
  15.         row = [i.text for i in td]
  16.         print(row)
  17.  
  18. for e in page.select(".text"):
  19.     osoba = e.find_all("h3")
  20.     for h3 in osoba:
  21.         dane = [i.text for i in osoba]
  22.     for x in dane:
  23.         print(x[:x.index("\n")])
  24.         print(x[x.index(' pok√≥j'):x.index("K")])
  25.     print(dane)
  26.  
  27.  
  28. for e in page.select(".text.h3"):
  29.     pokoj = e.find_all("span")
  30.     for span in pokoj:
  31.         pok_kons = [i.text for i in pokoj]
  32.     for x in pok_kons:
  33.         print(x[:x.index("\n")])
  34.     print(pok_kons)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top