weixin_33696822 2017-11-05 10:14 采纳率: 0%
浏览 51

获取ajax过滤的URL

for example i wanna buy laptop. so i go to www.example.com and i go to laptop section. url is : example.com/laptops and in the filter section i choose asus and the url still is: example.com/laptops

i tried to record what is going on when i hit asus checkbox :

action=filter&filter=2&sort=desc&count=20&menu_name=6&down_price=100&up_price=14790000&groups=&filters_specific=&color=&keyword=&exist=0&special=1

it sends this information to the referer.

i wanna know how to get the url that always lead me to asus laptops in that site.

</div>
  • 写回答

1条回答 默认 最新

  • weixin_33682719 2017-11-05 10:49
    关注

    Pardon my arabic...when you go to the home page and click on the laptop(لپ-تاپ/) section ...the following URL comes

    https://www.mobileabi.com/product/لپ-تاپ/

    also on the right side the filter appears لپ تاپ و الترابوک

    Now from here whenever you check a product ..say acer... an ajax post request fired to the this url

    https://www.mobileabi.com/templates/user/modules/sellbasket/ajax.php

    you can check it in chrome by pressing F12>Network>XHR

    Now each of the brands are given an ID..you could find the group ID by inspect element...

    Acer : 216
    Lenovo :245
    Apple: 251 and so on...
    

    so for e.g. if Acer & Apple are checked in the filter..the URL post params would be groups:216,251 so only... acer & apple laptops would be selected in the post response... you wont see any change in the URL of browser

    in order to make the Post into a get Request you gotta change the ajax call at..

     $.ajax({
              url: "https://www.mobileabi.com/templates/user/modules/search/ajax.php",
                                    data: "action=search"+
                                          "&val="+$(this).val(),
                                    dataType: "html",
                                    cache: false,
                                    context: document.body,
                                    type: "POST",
    

    you have to change the type: "POST", to type: "GET",

    similar modification needs to be done on the server side

    评论

报告相同问题?