0

I am trying to execute a basic PyDictionary Python code, but I am getting a connection error even though I'm connected to the Internet.


Here is my code:

from PyDictionary import PyDictionary
dictionary=PyDictionary()
print (dictionary.meaning("Diligent"))

Error: The Following Error occured: HTTPConnectionPool(host='wordnetweb.princeton.edu', port=80): Max retries exceeded with url: /perl/webwn?s=Diligent (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000000000A207CC0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))None
pushkin
  • 9,575
  • 15
  • 51
  • 95
  • Sure it's the right URL? (try `http://wordnetweb.princeton.edu` instead of `wordnetweb.princeton.edu`) – ggdx May 30 '18 at 14:14
  • Actually its from PyDictionary package, I think yes. its a right URL. – harish bhavandla May 30 '18 at 14:15
  • Consider posting an issue [here](https://github.com/geekpradd/PyDictionary/issues) – pushkin May 30 '18 at 14:27
  • The error means that it couldn't connect to the URL that's used by `PyDictionary`, which is peculiar. I could just connect to it. This is a shot in the dark, but try reinstalling the module? Did you just install it? Is this your first time using it? – pushkin May 30 '18 at 14:31
  • Just to make sure, do you get the error if you run `from bs4 import BeautifulSoup; import requests; BeautifulSoup(requests.get('http://wordnetweb.princeton.edu/perl/webwn?s=Diligent').text, 'html.parser')` – pushkin May 30 '18 at 14:34
  • I am getting this error when i try to execute the above mentioned code – harish bhavandla May 31 '18 at 06:07
  • `gaierror Traceback (most recent call last) D:\anaconda\lib\site-packages\urllib3\connection.py in _new_conn(self) 140 conn = connection.create_connection( --> 141 (self.host, self.port), self.timeout, **extra_kw) 142 D:\anaconda\lib\site-packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options) 59 ---> 60 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 61 af, socktype, proto, canonname, sa = res` – harish bhavandla May 31 '18 at 06:08

0 Answers0