如何处理重定向然后解析器重定向的页面?使用 simple_html_dom

How to deal with the redirect and then parser redirected page? Using simple_html_dom

提问人:William 提问时间:3/19/2020 最后编辑:Patrick QWilliam 更新时间:3/19/2020 访问量:64

问:

我正在使用 simple_html_dom 来解析一些页面。现在我正在尝试解析此页面链接

如您所见,它仅在您第二次输入后才有效。我认为它一定是重定向或 cookie

由于我无法使用 HTML 做到这一点,我正在尝试使用 RSS。但是我需要仅以 HTML 格式提供的信息,特别是位置字段 RSS

$xml = simplexml_load_file('https://www.globalsportsjobs.com/index.php/page/adv_rss/command/getfeed/feed/4a2a139494ad1c02b7df790877737575');

    $parsed_results_array = array();
    foreach($xml as $entry) {
        foreach($entry->item as $item) {
            // $parsed_results_array[] = json_decode(json_encode($item), true);
            $items['title'] = (string) $item->title;
            $items['description'] = (string) $item->description;
            $items['link'] = (string) $item->link;
            $items['location'] = ?????????????;
            $parsed_results_array[] = $items;
        }
    }

我需要这些字段

IMAGE

php 解析 simple-html-dom

评论

0赞 Patrick Q 3/19/2020
从 RSS 中获取字段,并将其用作获取 HTML 的 URL。然后解析生成的 HTML 以获取位置。guid
0赞 William 3/20/2020
我想了想!但是,结果很多,解析器会很慢!没有办法直接从 HTML 获取它吗?如果您访问第一个链接并按 F5,您将看到页面加载,我相信问题出在 Cookie 上。
0赞 Patrick Q 3/20/2020
如果你不想要所有的结果,你如何确定你想要哪些结果?

答: 暂无答案