N
N
Newmo2017-08-22 12:53:58
Java
Newmo, 2017-08-22 12:53:58

How to get Headers and send Form Data to get the page later and parse it?

I am writing an Android program for myself and a few other comrades. I figured out the search, I send a request of the form:

doc = Jsoup.connect("https:www.site.ru")
                 .data("ajax_mode", "site_search")
                 .data("queryfr", Name)
                 .post();}

I successfully get an HTML page for parsing to display links to posts. Next, with the help of shouldOverrideUrlLoading I intercept the click on the link and open a new activity.

Here actually and a problem. If on the search from data there were only ajax_mode and queryfr, then on the page in the new activity data is generated or something, and looks like this:

settings:a:18:{s:2:"id";s:4:"4222";s:3:"ind";s:12:"NPWR05424_00";s:5:"pl_id";s:1:"5";s:8:"pl_alias";s:3:"ps4";s:8:"gs_alias";s:22:"battlefield_4_ps4_game";s:8:"tl_alias";b:0;s:5:"gs_id";s:4:"4493";s:8:"is_admin";i:0;s:11:"is_redactor";i:0;s:9:"is_action";i:0;s:14:"is_admin_helps";i:0;s:8:"is_helps";i:1;s:11:"is_platinum";i:1;s:13:"is_ajax_trops";i:1;s:12:"utl_progress";i:1560;s:15:"utl_count_trops";i:68;s:22:"utl_count_trops_no_dlc";i:43;s:11:"scroll_shag";i:0;}


If you completely send this, naturally the answer is returned in the form of a page. But for each post, this line is generated separately, and if at least one parameter is removed, then the response is an empty page.

I am not a programmer, and got into all the subtleties in 2 weeks. Actually the question is, is it possible to get this string and automatically send it to get the generated html?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Newmo, 2017-08-23
@Newmo

It turns out that data is generated already on the page. Just got it and sent it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question