Answer the question
In order to leave comments, you need to log in
Java, Android. How to emulate button clicks to change the rating in the Bash.im website?
I am writing a client for bash.im. Thank God, I learned to parse pages. But I can't programmatically emulate button presses to change the rating of some quote. I am using Jsoup library. I do everything using AsyncTask (for android)
Document doc = Jsoup.connect(url).get(); //get the site context
Elements btnPlus = doc.select("a[class=up]"); // get "+" button elements"
Elements rating = doc.select("span[class=rating-o]"); //get the "rating"
elements ratingUrl = btnPlus.get(15).absUrl("href"); //get the link of a specific button
ratingText = rating.get(15).text();//get info. about the rating of a particular quote,
Jsoup.connect(ratingUrl).userAgent("Mozilla").method(Method.POST).execute();
The error does not come out, but the press is not simulated either.
What am I doing wrong?
Answer the question
In order to leave comments, you need to log in
https://www.evernote.com/shard/s12/sh/0b871d89-abf...
Learn not only to parse, but also to debug what you parse ;)
For likes/unlikes, you need a regular POST request. You can see everything on the screen.
I forgot to clarify, you don't need to get the button code to like it. Enough id post.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question