Python: Open HTML website - how it works
This practical tip shows you how you can easily open an HTML website with Python.
Open HTML website with Python - how it works
Accessing a website with Python is very easy and can be programmed quickly:
- First of all you have to add the command "import webbrowser" (without quotes) at the beginning of your code so that the webbrowser module is imported and can be used.
- You can now easily access a website with Python by embedding the command "webbrowser.open ('// chip.de')" (without quotation marks) at a desired position in the code. In this case the CHIP website would be accessed.
More tips about Python in our CHIP guides
Tip: You can find further programming tutorials on our Python programming language topic page. There we show you, for example, how you can use the range and xrange functions.