python - httpError using mwclient with local MediaWiki -
i try create page using mwclient local mediawiki. wikipedia.org works fine. local mediawiki enter these commands:
import mwclient site = mwclient.site("192.168.1.143") the result following error:
file "/library/python/2.7/site-packages/mwclient/http.py", line 152, in request raise errors.httpstatuserror, (res.status, res) mwclient.errors.httpstatuserror: (404, <httplib.httpresponse instance @ 0x104368488>) if type ip or hostname in browser, works. same ping command.
i used url lib with:
a=urllib.urlopen('http://www.google.com/asdfsf') a.getcode() and got 200 ok code.
what's problem here? ideas?
the problem mwclient expects api.php (which uses access wiki) located @ /w/, location used wikimedia wikis, instead of directly under /, default.
per the documentation site, need use path parameter that:
site = mwclient.site('192.168.1.143', path='/')
Comments
Post a Comment