Skip to content
Advertisement

PhpHtmlPraser html find function won’t work

I’m trying to get the data out of html site. But i now that the line <span data-bind="data-title">Absolut Combat</span> exists. But my code won’t find it do you guys see anything wrong?

public function index(Request $request) 
{
    $url = 'https://umod.org/plugins';
    $dom = new Dom;
    $html = $dom->loadFromUrl($url);
    $html = $html->find('span[data-bind="data-title"]'); <-- Problem is here
    dd($html);
    return view('server.rustplugins');
}

Advertisement

Answer

I just used the json instead of writing a html grabber.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement