简体   繁体   中英

How to login into wordpress.com using HtmlUnit?

I want to programmatically login into wordpress.com.

I have already some code used to login into Wordpress standalone instances, but the Wordpress.com login has a different choregraphy.

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?

So it appears the wordpress.com website heavily uses Javascript in a way that is absolutly not compatible with lightweightness of 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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