Skip to content
Snippets Groups Projects
Commit a6bbfe7e authored by Dan Michael O. Heggø's avatar Dan Michael O. Heggø
Browse files

Merge pull request #67 from fhocutt/doc-improve

Added instructions for changing default user-agent
parents 90ddfd0a ff7e66ba
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,19 @@ HTTPS
To use https, specify the host as a tuple in the form of ``('https', hostname)``.
User-agents
-----------
Bots that run on Wikimedia wikis `require an informative user-agent for all
API requests <https://meta.wikimedia.org/wiki/User-Agent_policy>`. To change
the user-agent, you will need to include an appropriate parameter for
``clients_useragent`` when you initialize your ``Site``, as shown in the
following example:
.. code-block:: python
useragent = 'YourBot, based on mwclient v0.6.5. Run by User:You, you@gmail.com'
site = mwclient.Site(('https', 'en.wikipedia.org'), clients_useragent=useragent)
Example
-------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment