简体   繁体   English

如何使用 HtmlUnit 登录 wordpress.com?

[英]How to login into wordpress.com using HtmlUnit?

I want to programmatically login into wordpress.com.我想以编程方式登录 wordpress.com。

I have already some code used to login into Wordpress standalone instances, but the Wordpress.com login has a different choregraphy.我已经有一些代码用于登录 Wordpress 独立实例,但是 Wordpress.com 登录有不同的编排。

As far as I understand, when I enter my login, a first request is done returning no secret.据我了解,当我输入我的登录名时,第一个请求已完成,不返回任何秘密。

When I enter my login, the submitted form however contains some kind of secret:当我输入登录名时,提交的表单包含某种秘密:

username=my username
password=my password
remember_me=true
redirect_to=
client_id=a short client id
client_secret=a long client secret which looks like a hash
domain=

Where does it come from?它从何而来? And how can I emulate that login choregraphy using HtmlUnit?以及如何使用 HtmlUnit 模拟登录编排?

So it appears the wordpress.com website heavily uses Javascript in a way that is absolutly not compatible with lightweightness of HtmlUnit.因此,wordpress.com 网站似乎大量使用 Javascript,其方式与 HtmlUnit 的轻量级完全不兼容。 Seems like I'll have to replace my nice HtmlUnit code with usage of Selenium WebDriver, which I find sooo heavy (but which manipulates real browsers, that the developers of Wordpress.com unfortunatly target).似乎我必须用 Selenium WebDriver 替换我漂亮的 HtmlUnit 代码,我觉得它太重了(但它操纵真正的浏览器,Wordpress.Z4D236D9A2D102C5FE6AD1C50ZDA 的开发人员的目标)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM