Help wanted: Website testing inside Python code
Background
I'm trying to use Pyhton's
webbrowser module for testing a website with various pages, and one of the pages is
index.html
I can open this page using this code:
webbrowser.open(file:///[...]/public/index.html)
But if i instead use this code
webbrowser.open(file:///[...]/public/)
then i will get a list of the contents of that directory
Question
What do you suggest that i do if i want to test my website?
A few options that i can see:
* Changing a setting in the browser
* Setting up a local http server
* Asking Python's webbrowser to look for an index.html file (this would work the first time but not when navigating between pages)
I use Firefox and Chromium as browers and Python 3.8
#
python #
programming #
web #
question webbrowser — Convenient Web-browser controller — Python 3.9.1 documentation
docs.python.org