Skip to content

VinitChawda06/Reading-web-pages-through-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Read-Me

Web Scraping Code

This code retrieves the HTML content of a web page and prints each line of the content, split into words. It uses the urllib.request.urlopen() function to open a URL and returns a file-like object that can be used to read the content of the URL.

To run the code, simply execute the Python script in your preferred environment. The script retrieves the HTML content of the URL specified by urllib.request.urlopen(), and then iterates through each line of the content, splitting it into words using the split() function. The strip() function is used to remove any leading or trailing white space from each line.

If you want to modify the code to count the frequency of each word in the HTML content, you can uncomment the lines of code that are currently commented out. This will create a dictionary called count that maps each word in the HTML content to its frequency.

Note that this code may not work for all web pages, as some pages may require authentication or use dynamic content that cannot be retrieved using urllib.request.urlopen(). Also, some websites may have terms of service or robots.txt files that prohibit web scraping, so be sure to check the website's policies before using this code.

About

By just providing link of the website you can view the entire website

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages