<div> <div>from http import client</div> <div>from wordpress_xmlrpc import Client, WordPressPost</div> <div>from wordpress_xmlrpc.methods.posts import GetPosts</div> <div>from wordpress_xmlrpc.methods import posts</div> <div>from wordpress_xmlrpc import WordPressTerm</div> <div>from wordpress_xmlrpc.methods import taxonomies</div> <div>import random</div> <div>wp = Client('https://www.xacisco.net/xmlrpc.php', 'xxx', 'xxx')</div> <div>allposts=wp.call(GetPosts({'post_type': 'sfwd-topic', 'number': 1}))</div> <div>for thepost in allposts:</div> <div> #print(random.randint(8000100010,8999999919))</div> <div> '''</div> <div> 测试修改一个post</div> <div> '''</div> <div> post=WordPressPost()</div> <div> post.slug=str(random.randint(8000100010,8999999919))</div> <div> print (thepost.id,thepost.title,thepost.link)</div> <div> wp.call(posts.EditPost(thepost.id,post))</div> </div> <div>
这个在执行的过程中遇到401 的问题
是不是post本身给的参数太少了还是什么问题