Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import requests
- parola="elettrico"
- sito=["http://www.ansa.it","http://www.repubblica.it","http://www.ilgiornale.it"]
- for p in sito:
- print("Dal sito ",p," ho trovato:")
- pagina=requests.get(p)
- web=BeautifulSoup(pagina.content,"html.parser")
- testo=web.get_text()
- x=testo.split("\n")
- for r in x:
- if parola.lower() in r.lower():
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement