How can one distinguish the host and the port in an IPv6 URL?

The notation in that case is to encode the IPv6 IP number in square brackets: http://[2001:db8:1f70::999:de8:7648:6e8]:100/ That’s RFC 3986, section 3.2.2: Host A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets (“[” and “]”). This is the only place where … Read more

What’s the point in having “www” in a URL?

One of the reasons why you need www or some other subdomain has to do with a quirk of DNS and the CNAME record. Suppose for the purposes of this example that you are running a big site and contract out hosting to a CDN (Content Distribution Network) such as Akamai. What you typically do … Read more

Get query string parameters url values with jQuery / Javascript (querystring)

Anyone know of a good way to write a jQuery extension to handle query string parameters? I basically want to extend the jQuery magic ($) function so I can do something like this: Which would give me the value “test” in the following URL: http://www.example.com/index.php?search=test. I’ve seen a lot of functions that can do this … Read more

How to read html from a url in python 3

I looked at previous similar questions and got only more confused. In python 3.4, I want to read an html page as a string, given the url. In perl I do this with LWP::Simple, using get(). A matplotlib 1.3.1 example says: import urllib; u1=urllib.urlretrieve(url). python3 can’t find urlretrieve. I tried u1 = urllib.request.urlopen(url), which appears … Read more