Then convert curl syntax to Python and paste the headers in the list. Go to the Network tab, visit the target website, right-click on the request and copy as cURL. The easiest way to do it is from the Firefox or Chrome DevTools - or equivalent in your browser.
#Website blocker python windows#
Windows Users should create a copy of this hosts file. The ideal would be to copy it directly from the source. Note: some browsers will no more use system hosts file. Note: The location of the host file may be different for different operating systems. Check where you have the host file, and use such path (but look the format of the file before to modify). Using python file handling manipulation we will write the hostname in hosts.txt and remove the lines after your working hours. In this program, we will be mapping hostnames of websites to our localhost address. The host is an operating system file that maps hostnames to IP addresses. Snip of the contents of the hosts file What is the ‘hosts’ file?