When you’re in school/college in computer lab some time we can’t access some of websites because administrator blocked those websites and we can block child’s laptops too. Here we can see, who they doing these type of process by using python and without python code.
Blocking website without python
Host file use to map a connection between an IP address and domain names. We can’t directly edit in the hosts file so open the notepad in run as administrator and now open hosts file in C:\Windows\System32\drivers\etc\hosts this location and you can able to edit. Copy the localhost address and paste in new line and type which website you want to block. Save the file and close it then open the certain website you can’t access.
Blocking websites using python
It’s a simple code to block certain website.
Output