Here is the site http://sd.366.ru/ . How to parse? Tell me what it is written on and which way to look. In addition, login by login.
I understand that such a thing has its own api, answers to requests and need to be parsed, just how do I know what requests I have to do.
UPD Following your prompts, I came to the conclusion that using Jsoup I was able to log in to http://my.id-soft.ru (this is the same software running on the server as Intraservice).
public static void main(String[] ars) throws IOException { String userAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"; // Получаю токен Connection.Response resp1 = Jsoup.connect("http://my.id-soft.ru/auth/login").method(Connection.Method.GET).execute(); String token = resp1.parse().getElementsByTag("input").first().val().trim(); System.out.println(token); // Упаковываю все в пост и отправляю Connection.Response resp2 = Jsoup.connect("http://my.id-soft.ru/auth/login").referrer("http://my.id-soft.ru/auth/login").userAgent(userAgent) .data("_token", token, "login","Mylogin", "password", "qwerty").cookies(resp1.cookies()) .method(Connection.Method.POST).timeout(10000).execute(); Map<String, String> cookies = resp2.cookies(); Document doc = resp2.parse(); Now it’s not clear to me this: With each new request I have to send a token, password, login? Or I can only use cookies further. Or a token? A little confused about how to properly build the next query. But it's okay, the main thing that I need to understand is how to press buttons on the server side in such applications. Here I have a filter. I want to update with the filter pressed. I turn on Fiddler, press the filter button and the request is already underway. Just to show me the filter selection field. Well, it is loaded. Request such.
POST http://my.id-soft.ru/tickets/getPopupFilterData HTTP/1.1 Host: my.id-soft.ru Connection: keep-alive Content-Length: 12 Accept: */* Origin: http://my.id-soft.ru X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://my.id-soft.ru/tickets Accept-Encoding: gzip, deflate Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: laravel_session=eyJpdiI6IlBIMFUxNG5NQVкукикуки field=status As I see new here only field=status
After I select one of the statuses, I see the following request sent:
POST http://my.id-soft.ru/tickets/popupFilterDo HTTP/1.1 Host: my.id-soft.ru Connection: keep-alive Content-Length: 8 Accept: */* Origin: http://my.id-soft.ru X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://my.id-soft.ru/tickets Accept-Encoding: gzip, deflate Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: laravel_session=eyJpdiI6Ill2WVRUbFVLd1lXeXpxQlVкукикуки status=2 New here only status=2 Well and further after the choice the filter itself works. So the question is, do I have to first make a request with field=status , and then with status=2 or just the last request? If this were the site I would be interested in the final result, then it can not roll. Of course, it’s not a problem to experiment, but I’m not able to add this status to the request. I would attach the response of the parser during authorization, but it is huge. Although the necessary part can eat in this
<ul class="tabs_content"> <li name="tabs11" class="tabs_content_active"> <div id="filterStatusContainer" style="display: none;"> <input type="button" id="filterStatusCancel" value="" onClick="location.href='http://my.id-soft.ru/tickets/clearFilter'" style="margin-right: 5px;"> <input type="checkbox" id="filterStatusCheckbox" onClick="changeFilterStatus($(this))" style="display: none;"> <span> </span> <input type="button" id="filterStatusProperties" value="Настроить" style="display: none;"> </div> <div id="scroll_table35" class="scrollTable" style="border-top: 1px solid #a9a9a9; background-color: #fafafa;"> <div class="content"> <table border="0" cellspacing="0" cellpadding="0" class="sort_table_header"> <tbody> <tr class="top_tr_border"> <th name="col00" width="74">№<input type="button" class="tableFilterBtn" name="tableFilterId" value=""></th> <th name="col05" width="130">Приоритет<input type="button" class="tableFilterBtn" name="priority" value=""></th> <th name="col02" width="126">Дата создания<input type="button" class="tableFilterBtn" name="tableFilterDateCreate" value=""></th> <th name="col04" width="586">Адрес размещения<input type="button" class="tableFilterBtn" name="tableFilterLocName" value=""></th> <th name="col03" width="98">Код 1С<input type="button" class="tableFilterBtn" name="tableFilterLocId" value=""></th> <th name="col02" width="600">Тема<input type="button" class="tableFilterBtn" name="tableFilterSubjectName" value=""></th> <th name="col03" width="150">Статус<input type="button" class="tableFilterBtn" name="status" value=""></th> <th name="col04" width="300">Рабочая группа<input type="button" class="tableFilterBtn" name="tableFilterWrkGrpName" value=""></th> <th name="col04" width="200">Исполнитель<input type="button" class="tableFilterBtn" name="tableFilterSpecialist" value=""></th> <th name="col06" width="130">Срок<input type="button" class="tableFilterBtnOrderDesc orderBtn" name="date_target" value=""></th> </tr> </tbody> </table> <div id="scroll_table" class="scrollTable"> <div class="content"> <table border="0" cellspacing="0" cellpadding="0" class="sort_table_body"> <tbody> <tr class="" priority="5" name="946560" specialist="93791" status="2" subject="562" initiator="64507" location="4422" workgroup="82" onclick="get_ticket_data($(this));" ondblclick="get_ticket_data_dblclick($(this));"> As you can see there is such a line
<th name="col03" width="150">Статус<input type="button" class="tableFilterBtn" name="status" value=""></th> In which I can not in any way value = "2" slapped. Well, the questions are how to set the filter correctly and generally press the buttons, whether it is enough to send a request or have to use the Cilenium (I don’t know what it is, I understand what helps to press the buttons). Well and help to expose the filter if it is possible through request without everyones Silenium.
And by the way, I myself tried to add data("status","2") to the request, but the answer is not like the real one.