How to fetch a non-ascii url with urlopen?

Strictly speaking URIs can’t contain non-ASCII characters; what you have there is an IRI. To convert an IRI to a plain ASCII URI: non-ASCII characters in the hostname part of the address have to be encoded using the Punycode-based IDNA algorithm; non-ASCII characters in the path, and most of the other parts of the address … Read more

Python check if website exists

You can use HEAD request instead of GET. It will only download the header, but not the content. Then you can check the response status from the headers. For python 2.7.x, you can use httplib: import httplib c = httplib.HTTPConnection(‘www.example.com’) c.request(“HEAD”, ”) if c.getresponse().status == 200: print(‘web site exists’) or urllib2: import urllib2 try: urllib2.urlopen(‘http://www.example.com/some_page’) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)