from urllib.request import urlopen
from bs4 import BeautifulSoup

url = "https://www.w3schools.com/java/java_encapsulation.asp"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')

text = soup.text
cleantext = BeautifulSoup(text, 'html5lib').text
newtext = soup.get_text(strip = True)
print(newtext)

tokens = [t for t in newtext.split()]
print(tokens)

#if 'encapsulation' in cleantext:
    #print('Success!')
#else: print('Fail!')
f98d3e218d1918d8357ef1bd7ba062e1d95a6f44
<mask token>

<mask token>
print(newtext)
<mask token>
print(tokens)

<mask token>
url = 'https://www.w3schools.com/java/java_encapsulation.asp'
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
text = soup.text
cleantext = BeautifulSoup(text, 'html5lib').text
newtext = soup.get_text(strip=True)
print(newtext)
tokens = [t for t in newtext.split()]
print(tokens)

from urllib.request import urlopen
from bs4 import BeautifulSoup
url = 'https://www.w3schools.com/java/java_encapsulation.asp'
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
text = soup.text
cleantext = BeautifulSoup(text, 'html5lib').text
newtext = soup.get_text(strip=True)
print(newtext)
tokens = [t for t in newtext.split()]
print(tokens)

from urllib.request import urlopen
from bs4 import BeautifulSoup

url = "https://www.w3schools.com/java/java_encapsulation.asp"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')

text = soup.text
cleantext = BeautifulSoup(text, 'html5lib').text
newtext = soup.get_text(strip = True)
print(newtext)

tokens = [t for t in newtext.split()]
print(tokens)

#if 'encapsulation' in cleantext:
    #print('Success!')
#else: print('Fail!')