Quantcast
Channel: Active questions tagged python - Webmasters Stack Exchange
Viewing all articles
Browse latest Browse all 46

How to access Windows XAMPP localhost website using Python

$
0
0

I'm using XAMPP on Windows to work on a new version of my website. I have modified the Windows hosts file and the XAMPP Apache httpd-vhosts.conf file so that my browsers access the version of the website that is in my XAMPP htdocs directory.This works fine with my browsers but I want to use Python to access the site as well with code like with the following

from urllib.request import urlopenwebpage = "http://www.thedomain.org/index.html"page = urlopen(webpage)

Running this code I get the following error:

URLError: <urlopen error [WinError 10061] No connection could be madebecause the target machine actively refused it>

Any ideas on what configuration change(s) I need to make so that Python can access the local copy of my website just like it accesses websites normally? Thanks.


Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>