converting URI to URL using python

I have a list of printers and I got their URI using pycups. now I need to know their IP addresses and to do that, I need to know their URL. How can I convert those URIs to URLs? for example, I have this URI: dnssd://HP%20LaserJet%20M402dn%20(0988D9)-0._ipp._tcp.local/ And I need to know the ip address of my printer. how can I do it? when I use socket.gethostbyaddr() to find it, I get an exception that name or service not known

Upvotes: 2

Views: 343

Answers (0)

Related Questions