Symfony HttpClient и простой HTML DOM?Php

Кемеровские программисты php общаются здесь
Гость
Symfony HttpClient и простой HTML DOM?

Сообщение Гость »


I use Symfony\Component\HttpClient\HttpClient to retrieve the page content because I use a proxy.

Код: Выделить всё

// Customizing the client
$this->httpClient = HttpClient::create(
[
'proxy' => $connection,
]
);
// I get the content of the page - everything loads normally, in the variable $web string
$web = $this->httpClient->request('GET',  'yandex.ru')->getContent();
Forced to string, cast, same on output. $web = (string) $web;

Код: Выделить всё

// В $this->client / use simplehtmldom\HtmlWeb;
$this->client->load($web);
// result null
If I pass simple html dom directly - everything loads fine, it is the Symfony HttpClient format that is not friendly.


Источник: https://stackoverflow.com/questions/781 ... e-html-dom

Вернуться в «Php»