KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there an API to programmatically access to the Java documentation ? Something similar to what editors/IDEs like Eclipse do for IntelliSense. Surely, the javadoc generated html can be parsed and indexed, but would be great to know if something already exists as a standalone package. Update: To be clear, I am trying to get a programmatic access to the documentation for the Java language implementation. However, there isn't an easy way out, but you have to get the openjdk from Oracle's site and then do make docs and supply some doclet to get the output in non-html form. This is what I was trying to avoid from the beginning. So I'm reading all the Makefiles now trying to figure out why $PLATFORM isn't being resolved and source build is failing! What I finally settled with: Scraping html docs. Yep. Realized that'd get my job done. import urllib2 import pymongo mongo = pymongo.Connection('localhost') mongo_db = mongo['api_db'] mongo_collection = mongo_db['api_collection'] URL='''http://docs.oracle.com/javase/6/docs/api/index-files/index-''' URL_range = 27+1 def getPageElements(url): content=urllib2.urlopen(url).read() from BeautifulSoup import BeautifulSoup soup = BeautifulSoup(content) elements = soup('dl') return elements def savePageElements(elements): for i in elements[0]: try: entry={'type_description':str(i.findNext('dt')).split('-')[1].split('<')[0]\ +i.findNext('a').findNext('a').renderContents(),\ 'signature':i.findNext('a').findNext('a').renderContents()+i.findNext('b').renderContents(),\ 'description': i.findNext('dd').renderContents()\ } print entry insert_id = mongo_co
Tags (comma-separated)
Save Edits
Cancel