用JavaScript抓刮wizzair网站

时间:2018-04-05 20:09:12

标签: javascript ajax web-scraping

我正在尝试从wizzair API获得一些回复(没有官方文档,我在开发工具中遇到了XHR)。

到目前为止,我确定有 网址https://be.wizzair.com/7.10.1/Api/search/search

和通过POST方法传递的对象有效负载以获取数据。

如何通过POST将对象传递给URL?

这是我给出404的尝试。

$.ajax({
    method:     "POST",
    type:       "json",
    url:        url+payload,
    success:    function (data) {
                    console.log(data);
                }
    ,
    error:      function (xhr, ajaxOptions, thrownError) {

                    alert(xhr.status);
                    alert(thrownError);
    },
});

另一个问题是 No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.

see image of dev tools

0 个答案:

没有答案