I need to count words that are inside a webpage using python3. Which module should I use? urllib?
Here is my Code:
def web():
f =("urllib.request.urlopen("https://americancivilwar.com/north/lincoln.html")
lu = f.read()
print(lu)
I need to count words that are inside a webpage using python3. Which module should I use? urllib?
Here is my Code:
def web():
f =("urllib.request.urlopen("https://americancivilwar.com/north/lincoln.html")
lu = f.read()
print(lu)
Copyright © 2021 Jogjafile Inc.
With below self explained code you can get a good starting point for counting words within a web page:
If you want for example the first 10 most common words you just do:
Which in this case outputs: