Used under mint 18, similar to Ubuntu.
Method :
- Install goldendict through Software Center, or
sudo apt install goldendict
- Through the web crawler, see the Appendix
- Download the lang Dao dictionary file, refer here
- Configuration such as
* * Use * *
- Mouse selected
- Shortcut keys
ctl + C + C
Python parsing scripts
#encoding: Utf-8ImportUrllib fromUrllibImportRequest fromlxmlImportEtree fromSysImportArgvif __name__ == "__main__": URL= ' http://dict.youdao.com/w/eng/{}/#keyfrom =dict2.index 'Word=argv[1] Word=Word.replace ("/","/")# URL method to filter out/switch to full-widthWord=Urllib.parse.quote (Word)# Chinese is handled here, otherwise there will be a problem with Chinese input. Turl=Url.format(word)#turl = Urllib.parse.quote (Turl, safe= '/:?= ') withRequest.urlopen (Turl) asF:data=F.read ()# Read Data note Data return bytesSelector=Etree. HTML (data)# Generate Selector object, use XPath to get contentContent=Selector.xpath ("//div[@id = ' results-contents ']")[0] Content=Etree.tostring (Content, encoding=' Utf-8 ', method=' HTML ')Print(Content.decode (' Utf-8 '))
Linux Configuration Dictionary Goldendict