$url = "https://www.facebook.com/marketplace/category/electronics/";
$html[0] = file_get_contents($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.facebook.com/marketplace/106039436102339/electronics/?exact=false&sortBy=creation_time_descend');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75");
curl_setopt($ch, CURLOPT_REFERER, "http://www.facebook.com");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$page = curl_exec($ch) or die(curl_error($ch));
echo $page;
<?php
class LigaAPI
{
const BASE_URL = 'http://fantasyland.ru/cgi/';
/**
* @var resource Дескриптор cURL соединения
*/
protected $handler;
/**
* @var bool Игрок авторизован?
*/
protected $logged = FALSE;
/**
* @var int Текущее местоположение игрока
*/
protected $place = 0;
/**
* @var int Текущая локация игрока
*/
protected $location = 0;
/**
* @var array Места на карте
*/
protected $places = array(
2 => 'Столица',
3 => 'Лагерь Наемников',
4 => 'Замок Паладинов',
5 => 'Шахты',
6 => 'Илдиор',
7 => 'Лагденойский Лес',
9 => 'Башня Хаоса',
11 => 'Ведьмины Топи',
12 => 'Торговый Порт',
13 => 'Долина Магов',
14 => 'Лесной Замок',
16 => 'Горный Замок',
17 => 'Руины',
18 => 'Пещеры Драконов',
19 => 'Башня Смерти',
20 => 'Болотный Замок',
23 => 'Пустынный Замок',
25 => 'Каменный Клык',
26 => 'Лотариель',
27 => 'Маковый Лес',
33 => 'Заброшенная Ферма',
);
/**
* @var array Локации на местах
*/
protected $locations = array();
/**
* Инициализация параметров объекта
*
* @return void
*/
public function __construct()
{
// Инициализация соединения
$this->handler = curl_init();
// Создать файл для хранения куки
if (! is_file('cookie_liga_api'))
{
file_put_contents('cookie_liga_api', '');
}
// Основные настройки соединения
$options = array(
CURLOPT_FOLLOWLOCATION => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HEADER => FALSE,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0',
CURLOPT_COOKIEFILE => 'cookie_liga_api',
CURLOPT_COOKIEJAR => 'cookie_liga_api',
CURLOPT_CONNECTTIMEOUT => 5,
);
curl_setopt_array($this->handler, $options);
if (! isset($_SESSION))
{
session_start();
}
if (isset($_SESSION['liga_api']))
{
list($this->place, $this->location, $this->locations) = $_SESSION['liga_api'];
$this->logged = TRUE;
}
}
/**
* Закрытие соединения при завершении работы
*
* @return void
*/
public function __destruct()
{
curl_close($this->handler);
}
/**
* Получение контента страницы
*
* @return string
* @throws Exception
*/
public function request($url, array $post = array())
{
$options = array(
CURLOPT_URL => self::BASE_URL . $url,
CURLOPT_POST => ! empty($post),
CURLOPT_POSTFIELDS => $post,
);
curl_setopt_array($this->handler, $options);
$response = curl_exec($this->handler);
if ($response === FALSE)
{
throw new Exception(__METHOD__ . ' ' . $url . ': ' . curl_error($this->handler));
}
return iconv('Windows-1251', 'UTF-8', $response);
}
/**
* Получение и парсинг контента страницы
*
* @return array
*/
public function parse($text, $regex, $all = FALSE)
{
if ($all)
{
preg_match_all('#' . $regex . '#muU', $text, $matches, PREG_SET_ORDER);
}
else
{
preg_match('#' . $regex . '#muU', $text, $matches);
}
return (array) $matches;
}
/**
* Авторизация в игре
*
* @return this
*/
public function login($login, $password)
{
if (! $this->logged)
{
$this->request('../login.php', compact('login', 'password'));
$this->logged = TRUE;
$_SESSION['liga_api'] = array(
'place' => $this->place,
'location' => $this->location,
'locations' => $this->locations,
);
}
return $this;
}
/**
* Выйти из игры
*
* @return this
*/
public function logout()
{
if ($this->logged)
{
$this->request('exit.php');
$this->logged = FALSE;
unset($_SESSION['liga_api']);
}
return $this;
}
/**
* Авторизация в игре
*
* @return this
*/
public function loadInfo()
{
$response = $this->request('loc_list.php');
list(, $this->place, $this->location) = $this->parse($response, 'curPlace=([\d]+); curLoc=([\d]+);');
$filename = 'locations_' . $this->place . '.php';
if (is_file($filename))
{
$this->locations = include $filename;
}
else
{
$data = $this->parse($response, "push\(\['([^']+)', ([\d]+)\]", TRUE);
foreach ($data as $value)
{
$this->locations[$value[2]] = str_replace(' ', ' ', $value[1]);
}
file_put_contents($filename, '<?php return ' . var_export($this->locations, TRUE) . ';');
}
$_SESSION['liga_api'] = array(
'place' => $this->place,
'location' => $this->location,
'locations' => $this->locations,
);
return $this;
}
/**
* Перейти в локацию
*
* @return string
*/
public function loadLocation($location = NULL)
{
if (is_null($location))
{
// Load current location
return $this->request('no_combat.php');
}
if (! $this->locations)
{
$this->loadInfo();
}
if (! in_array($location, $this->locations))
{
throw new Exception(__METHOD__ . ' location ' . $location . ' not exist');
}
$location = array_search($location, $this->locations);
$response = $this->request('no_combat.php', array('locat' => $location, 'additional' => 0));
$_SESSION['liga_api']['location'] = $this->location = $location;
return $response;
}
/**
*
*
* @return string
*/
public function getPlace()
{
if (! $this->place)
{
$this->loadInfo();
}
return $this->places[$this->place];
}
/**
*
*
* @return string
*/
public function getLocation()
{
if (! $this->location)
{
$this->loadInfo();
}
return $this->locations[$this->location];
}
}
Marketplace недоступен для вас
Это сообщение показывается, если вы на Facebook недавно, Marketplace пока не поддерживается в вашей стране или ваш аккаунт не отвечает нашим требованиям. Подробнее см. в нашем Справочном центре.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.facebook.com/marketplace/106039436102339/electronics/?exact=false&sortBy=creation_time_descend');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75");
curl_setopt($ch, CURLOPT_REFERER, "http://www.facebook.com");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$page = curl_exec($ch) or die(curl_error($ch));
echo $page;
?>
Sorry! Something went wrong :(
$options = [
'http'=> [
'follow_location' => 1,
'user_agent' => 'Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0',
//'proxy' => '',
]
];
$context = stream_context_create($options);
$url = "https://www.facebook.com/marketplace/category/electronics/";
$html = file_get_contents($url, false, $context);
<?php
$options = [
'http'=> [
'follow_location' => 1,
'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75',
]
];
$context = stream_context_create($options);
$url = "https://www.facebook.com/marketplace/category/electronics/";
$html = file_get_contents($url, false, $context);
echo $html;
?>
curl "https://www.facebook.com/api/graphql/" ^
-H "authority: www.facebook.com" ^
-H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75" ^
-H "content-type: application/x-www-form-urlencoded" ^
-H "accept: */*" ^
-H "origin: https://www.facebook.com" ^
-H "sec-fetch-site: same-origin" ^
-H "sec-fetch-mode: cors" ^
-H "sec-fetch-dest: empty" ^
-H "referer: https://www.facebook.com/marketplace/category/electronics" ^
-H "accept-language: ru,en;q=0.9,en-GB;q=0.8,en-US;q=0.7,et;q=0.6" ^
-H "cookie: datr=2qr4X0nrqkswPyf1IWZCpK64; dpr=2; _fbp=fb.1.1610132370255.1168812619; sb=0bj4X4_X31YtXgXhZiLxpdV4; m_pixel_ratio=2; locale=ru_RU; fr=0NN0EQsFk5qxmAySO.AWX7L3rjuhGpZFudBK7kLqYkM68.Bf-Kz9.e3.F_7.0.0.Bf-3YO.AWXU8E9nlsA; wd=1027x980" ^
--data-raw "av=0^&__user=0^&__a=1^&__dyn=7xe6HwkEowBwRyWwHBWo2vwAxu13wvoKewSwMwNw9G2S0wE2ywUx609vCwjE1xoswaq0woy1Qw5MKdwGwFyE2ly87e2l0FG1Cwc61uwPyoaoaU5q4Uqw8y4UaEW2C1OwwwJK2W2K0zK5o4q0Gogxq^&__csr=^&__req=d^&__beoa=0^&__pc=EXP1^%^3Acomet_pkg^&dpr=2^&__ccg=EXCELLENT^&__rev=1003171334^&__s=4sbu09^%^3Abxyrlz^%^3Az811lj^&__hsi=6916251618876813947-0^&__comet_req=1^&lsd=AVppvqWXB_A^&jazoest=21007^&__spin_r=1003171334^&__spin_b=trunk^&__spin_t=1610315316^&fb_api_caller_class=RelayModern^&fb_api_req_friendly_name=CometMarketplaceSearchContentPaginationQuery^&variables=^%^7B^%^22count^%^22^%^3A24^%^2C^%^22cursor^%^22^%^3A^%^22^%^7B^%^5C^%^22pg^%^5C^%^22^%^3A0^%^2C^%^5C^%^22cf^%^5C^%^22^%^3A^%^7B^%^5C^%^22basic^%^5C^%^22^%^3A^%^7B^%^5C^%^22item_index^%^5C^%^22^%^3A27^%^7D^%^2C^%^5C^%^22ads^%^5C^%^22^%^3A^%^7B^%^5C^%^22items_since_last_ad^%^5C^%^22^%^3A24^%^2C^%^5C^%^22items_retrieved^%^5C^%^22^%^3A24^%^2C^%^5C^%^22ad_index^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_slot^%^5C^%^22^%^3A3^%^2C^%^5C^%^22dynamic_gap_rule^%^5C^%^22^%^3A0^%^2C^%^5C^%^22counted_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22average_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_gap_rule_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22first_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_initial_gap_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22iterated_organic_items^%^5C^%^22^%^3A21^%^2C^%^5C^%^22top_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_slice_number^%^5C^%^22^%^3A1^%^2C^%^5C^%^22feed_retrieved_items^%^5C^%^22^%^3A24^%^2C^%^5C^%^22ad_req_id^%^5C^%^22^%^3A0^%^2C^%^5C^%^22refresh_ts^%^5C^%^22^%^3A0^%^2C^%^5C^%^22cursor_id^%^5C^%^22^%^3A17676^%^2C^%^5C^%^22mc_id^%^5C^%^22^%^3A0^%^7D^%^2C^%^5C^%^22boosted_ads^%^5C^%^22^%^3A^%^7B^%^5C^%^22items_since_last_ad^%^5C^%^22^%^3A0^%^2C^%^5C^%^22items_retrieved^%^5C^%^22^%^3A24^%^2C^%^5C^%^22ad_index^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_slot^%^5C^%^22^%^3A0^%^2C^%^5C^%^22dynamic_gap_rule^%^5C^%^22^%^3A0^%^2C^%^5C^%^22counted_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22average_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_gap_rule_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22first_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_initial_gap_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22iterated_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22top_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_slice_number^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_retrieved_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_req_id^%^5C^%^22^%^3A0^%^2C^%^5C^%^22refresh_ts^%^5C^%^22^%^3A0^%^2C^%^5C^%^22cursor_id^%^5C^%^22^%^3A24928^%^2C^%^5C^%^22mc_id^%^5C^%^22^%^3A0^%^7D^%^2C^%^5C^%^22lightning^%^5C^%^22^%^3A^%^7B^%^5C^%^22initial_request^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22top_unit_item_ids^%^5C^%^22^%^3Anull^%^2C^%^5C^%^22ranking_signature^%^5C^%^22^%^3Anull^%^2C^%^5C^%^22qid^%^5C^%^22^%^3Anull^%^7D^%^7D^%^2C^%^5C^%^22rcf^%^5C^%^22^%^3A^%^7B^%^5C^%^22basic^%^5C^%^22^%^3A^%^7B^%^5C^%^22item_index^%^5C^%^22^%^3A0^%^7D^%^2C^%^5C^%^22ads^%^5C^%^22^%^3A^%^7B^%^5C^%^22items_since_last_ad^%^5C^%^22^%^3A0^%^2C^%^5C^%^22items_retrieved^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_index^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_slot^%^5C^%^22^%^3A0^%^2C^%^5C^%^22dynamic_gap_rule^%^5C^%^22^%^3A0^%^2C^%^5C^%^22counted_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22average_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_gap_rule_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22first_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_initial_gap_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22iterated_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22top_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_slice_number^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_retrieved_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_req_id^%^5C^%^22^%^3A0^%^2C^%^5C^%^22refresh_ts^%^5C^%^22^%^3A0^%^2C^%^5C^%^22cursor_id^%^5C^%^22^%^3A60631^%^2C^%^5C^%^22mc_id^%^5C^%^22^%^3A0^%^7D^%^2C^%^5C^%^22boosted_ads^%^5C^%^22^%^3A^%^7B^%^5C^%^22items_since_last_ad^%^5C^%^22^%^3A0^%^2C^%^5C^%^22items_retrieved^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_index^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_slot^%^5C^%^22^%^3A0^%^2C^%^5C^%^22dynamic_gap_rule^%^5C^%^22^%^3A0^%^2C^%^5C^%^22counted_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22average_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_gap_rule_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22first_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22is_dynamic_initial_gap_set^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22iterated_organic_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22top_organic_score^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_slice_number^%^5C^%^22^%^3A0^%^2C^%^5C^%^22feed_retrieved_items^%^5C^%^22^%^3A0^%^2C^%^5C^%^22ad_req_id^%^5C^%^22^%^3A0^%^2C^%^5C^%^22refresh_ts^%^5C^%^22^%^3A0^%^2C^%^5C^%^22cursor_id^%^5C^%^22^%^3A43587^%^2C^%^5C^%^22mc_id^%^5C^%^22^%^3A0^%^7D^%^2C^%^5C^%^22lightning^%^5C^%^22^%^3A^%^7B^%^5C^%^22initial_request^%^5C^%^22^%^3Atrue^%^2C^%^5C^%^22top_unit_item_ids^%^5C^%^22^%^3Anull^%^2C^%^5C^%^22ranking_signature^%^5C^%^22^%^3Anull^%^2C^%^5C^%^22qid^%^5C^%^22^%^3Anull^%^7D^%^7D^%^2C^%^5C^%^22ncfp^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22ncfr^%^5C^%^22^%^3Afalse^%^2C^%^5C^%^22cfrh^%^5C^%^22^%^3Atrue^%^7D^%^22^%^2C^%^22params^%^22^%^3A^%^7B^%^22bqf^%^22^%^3A^%^7B^%^22callsite^%^22^%^3A^%^22COMMERCE_MKTPLACE_SEO^%^22^%^2C^%^22query^%^22^%^3A^%^22^%^22^%^7D^%^2C^%^22browse_request_params^%^22^%^3A^%^7B^%^22commerce_enable_local_pickup^%^22^%^3Atrue^%^2C^%^22commerce_enable_shipping^%^22^%^3Atrue^%^2C^%^22commerce_search_and_rp_category_id^%^22^%^3A^%^5B1792291877663080^%^5D^%^2C^%^22commerce_search_and_rp_condition^%^22^%^3Anull^%^2C^%^22commerce_search_and_rp_ctime_days^%^22^%^3Anull^%^2C^%^22filter_location_latitude^%^22^%^3A59.416809082031^%^2C^%^22filter_location_longitude^%^22^%^3A24.746704101562^%^2C^%^22filter_price_lower_bound^%^22^%^3A0^%^2C^%^22filter_price_upper_bound^%^22^%^3A214748364700^%^2C^%^22filter_radius_km^%^22^%^3A60^%^7D^%^2C^%^22custom_request_params^%^22^%^3A^%^7B^%^22contextual_filters^%^22^%^3A^%^5B^%^5D^%^2C^%^22saved_search_strid^%^22^%^3Anull^%^2C^%^22search_vertical^%^22^%^3Anull^%^2C^%^22seo_url^%^22^%^3A^%^22electronics^%^22^%^2C^%^22surface^%^22^%^3A^%^22TOPIC_PAGE^%^22^%^2C^%^22virtual_contextual_filters^%^22^%^3A^%^5B^%^5D^%^7D^%^7D^%^2C^%^22scale^%^22^%^3A2^%^7D^&server_timestamps=true^&doc_id=3567754026643659" ^
--compressed
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.facebook.com/api/graphql/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
$headers = array();
$headers[] = 'Authority: www.facebook.com';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75';
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.facebook.com';
$headers[] = 'Sec-Fetch-Site: same-origin';
$headers[] = 'Sec-Fetch-Mode: cors';
$headers[] = 'Sec-Fetch-Dest: empty';
$headers[] = 'Referer: https://www.facebook.com/marketplace/category/electronics';
$headers[] = 'Accept-Language: ru,en;q=0.9,en-GB;q=0.8,en-US;q=0.7,et;q=0.6';
$headers[] = 'Cookie: datr=2qr4X0nrqkswPyf1IWZCpK64; dpr=2; _fbp=fb.1.1610132370255.1168812619; sb=0bj4X4_X31YtXgXhZiLxpdV4; m_pixel_ratio=2; locale=ru_RU; wd=1027x980; fr=0NN0EQsFk5qxmAySO.AWVHtweNVyFUENvAfXKAHzfAYoE.Bf-Kz9.e3.F_7.0.0.Bf-3g6.AWUblK8R-28';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Обзор
URL: https://www.facebook.com/api/graphql/
Статус: 200
Источник: Сеть
Адрес: 157.240.194.35:443
Инициатор:
D020-OxzLv0.js:137:5103
Запрос
:method: POST
:scheme: https
:authority: www.facebook.com
:path: /api/graphql/
Accept: */*
Content-Type: application/x-www-form-urlencoded
Origin: https://www.facebook.com
Cookie: c_user=100002380436476; fr=1uSU07RrFB6EuOw7t.AWVllLLVtaSEnlZQ4OkkmZzu87A.BfzMIH.hz.F_7.0.0.Bf_K1e.AWW8LMqsRR4; spin=r.1003172213_b.trunk_t.1610394974_s.1_v.2_; xs=4%3A77zU69615NecDA%3A2%3A1607254535%3A13937%3A4004%3A%3AAcWYwxoM6tiHWkq3n-BBdDJe5WEDLrntuWImc5wxyUg; wd=1680x883; x-referer=eyJyIjoiL21hcmtldHBsYWNlLz9yZWY9Ym9va21hcmtzJmFwcF9pZD0xNjA2ODU0MTMyOTMyOTU1IiwiaCI6Ii9tYXJrZXRwbGFjZS8%2FcmVmPWJvb2ttYXJrcyZhcHBfaWQ9MTYwNjg1NDEzMjkzMjk1NSIsInMiOiJtb2JpbGUifQ%3D%3D; m_pixel_ratio=2; _fbp=fb.1.1610291847884.2025494105; dpr=2; datr=AsLMX3AO9DTgC3a82Cg9zvKT; sb=B8LMX3whRwpF55z2fkK1KnE6
Content-Length: 3261
Accept-Language: ru
Host: www.facebook.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Referer: https://www.facebook.com/marketplace/
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Ответ
:status: 200
Access-Control-Allow-Origin: https://www.facebook.com
Content-Type: text/html; charset="utf-8"
Pragma: no-cache
Content-Security-Policy: default-src * data: blob: 'self';script-src *.facebook.com *.fbcdn.net *.facebook.net *.google-analytics.com *.virtualearth.net *.google.com 127.0.0.1:* *.spotilocal.com:* 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src data: blob: 'unsafe-inline' *;connect-src *.facebook.com facebook.com *.fbcdn.net *.facebook.net *.spotilocal.com:* wss://*.facebook.com:* https://fb.scanandcleanlocal.com:* attachment.fbsbx.com ws://localhost:* blob: *.cdninstagram.com 'self';block-all-mixed-content;upgrade-insecure-requests;
Content-Encoding: gzip
Access-Control-Allow-Methods: OPTIONS
X-XSS-Protection: 0
Access-Control-Expose-Headers: X-FB-Debug, X-Loader-Length
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Cache-Control: private, no-cache, no-store, must-revalidate
Date: Mon, 11 Jan 2021 19:56:49 GMT
Access-Control-Allow-Credentials: true
X-Content-Type-Options: nosniff
Vary: Origin, Accept-Encoding
X-Frame-Options: DENY
x-fb-debug: mYAg0KSyajVtHSPOS+JaT2uJ67pQaO0vLG9MrnWOFgpSbor4KB9tt5jsPN+gkZRbC1fU1TKySnIrPYK0VunsJQ==
x-fb-rlafr: 0
Alt-Svc: h3-29=":443"; ma=3600,h3-27=":443"; ma=3600
Strict-Transport-Security: max-age=15552000; preload
Данные запроса
MIME-тип: application/x-www-form-urlencoded
av: 100002380436476
__user: 100002380436476
__a: 1
__dyn: 7AzHxqU5a5Q2m3mbG2KnFw9uu2i5U4e1ZyUW3q32363K1uwJxS1AwWwpUe8hw2nVEtwMw65xO0FE88628wgolzUO0n2US2G2Caw9m8wsU9kbxSE6q0Mo5W3e9xy48aU5qfK6E7e58jwGzE2sxGm2SUnxq5olwUwHxm4-5o4q3y1Mzqxq2K2-
__csr: ggPsvPiNa4N4ApZZN5F8GuNJiRNbhrHF-y4OWpatRiGXFfCh8GV5BKr_AWEyLABHAjCp5GjyV98Feh9Z4AGrCxC2xV9E-F8_yUymmFaKaHyqWzpHhEGp7l5zF9UoCKm8z8ix7GgxEN6DxWqrzEO9h4FoCu4qBDAx24oDxPKmuU_wKVpEpx68xy58jxd0xx9a4EbosAAzaUfoN1qq582XyU88gxq2-V8XxK2m8woojwIwVzbwhk2G2e1qBzoybxm3S58pwCxKbyXw0L2w0isU236F9o0Tp064wch0820C448yiq9BAzoao4O75wHw5Mg2Nw0TLw
__req: g
__beoa: 0
__pc: EXP2:comet_pkg
dpr: 2
__ccg: EXCELLENT
__rev: 1003172213
__s: haynj3:iqmk53:vaoygx
__hsi: 6916593779143614139-0
__comet_req: 1
fb_dtsg: AQH3iqhnsPWK:AQFMJRQaxM_h
jazoest: 22139
__spin_r: 1003172213
__spin_b: trunk
__spin_t: 1610394981
fb_api_caller_class: RelayModern
fb_api_req_friendly_name: MarketplaceCometBrowseFeedLightPaginationQuery
variables: {"buyLocation":{"latitude":59.41855,"longitude":24.75171},"count":5,"cursor":"{\"basic\":{\"item_index\":5},\"ads\":{\"items_since_last_ad\":6,\"items_retrieved\":7,\"ad_index\":2,\"ad_slot\":2,\"dynamic_gap_rule\":0,\"counted_organic_items\":0,\"average_organic_score\":0,\"is_dynamic_gap_rule_set\":false,\"first_organic_score\":0,\"is_dynamic_initial_gap_set\":false,\"iterated_organic_items\":1,\"top_organic_score\":0,\"feed_slice_number\":2,\"feed_retrieved_items\":6,\"ad_req_id\":920043853,\"refresh_ts\":0,\"cursor_id\":9409,\"mc_id\":0},\"boosted_ads\":{\"items_since_last_ad\":0,\"items_retrieved\":7,\"ad_index\":0,\"ad_slot\":0,\"dynamic_gap_rule\":0,\"counted_organic_items\":0,\"average_organic_score\":0,\"is_dynamic_gap_rule_set\":false,\"first_organic_score\":0,\"is_dynamic_initial_gap_set\":false,\"iterated_organic_items\":0,\"top_organic_score\":0,\"feed_slice_number\":0,\"feed_retrieved_items\":0,\"ad_req_id\":0,\"refresh_ts\":0,\"cursor_id\":50436,\"mc_id\":0},\"lightning\":{\"initial_request\":false,\"top_unit_item_ids\":[3716082361781827,3568436279941798,3288653477907905,4995562120515806,3587812901255495,3696165533785835,3608428919223909,3323266594462911,3078079358968529,4001222449901830,3537409013046629,3700569876672143,3594299727291084,3617195381649696,4227103020651747,3164542650313320,3816302825099593,5031048756970339,3567835266635881,3235112126603970],\"ranking_signature\":8864037669663932416,\"qid\":6916593779813727506}}","imageWidth":256,"mediaType":"image/jpeg","radius":31000,"scale":2,"sizing":"cover-fill-cropped","useSDFPath":true}
server_timestamps: true
doc_id: 3212192612220638
{
"__typename": "GroupCommerceProductItem",
"id": "2847931948807724", // страница товара `https://www.facebook.com/marketplace/item/{id}/`
"primary_listing_photo": {
"__typename": "Photo",
"image": {
"uri": "https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-0\/c43.0.260.260a\/p261x260\/126459943_3501983189884214_6730841962174251261_n.jpg?_nc_cat=111&ccb=2&_nc_sid=3b2858&_nc_ohc=omsCjvSdK-sAX91cBu0&_nc_ht=scontent.xx&tp=27&oh=1fedfb95e4d2fbd45a94cfdeb4aafe54&oe=6025F841"
},
"id": "3501983176550882"
},
"__isMarketplaceListingRenderable": "GroupCommerceProductItem",
"formatted_price": {
"text": "\u20ac20"
},
"location": {
"reverse_geocode": {
"city": "Tallinn",
"state": "",
"city_page": {
"display_name": "Tallinn, Estonia",
"id": "106039436102339"
}
}
},
"is_hidden": false,
"is_live": true,
"is_pending": false,
"is_sold": false,
"is_viewer_seller": false,
"min_listing_price": null,
"max_listing_price": null,
"marketplace_listing_category_id": "1792291877663080",
"marketplace_listing_title": "KOHE OLEMAS - UUED juhtmevabad k\u00f5rvaklapid bluetooth airpods pods",
"custom_title": null,
"custom_sub_titles_with_rendering_flags": [],
"origin_group": null,
"pre_recorded_videos": [],
"__isMarketplaceListingWithChildListings": "GroupCommerceProductItem",
"parent_listing": null,
"__isMarketplaceListingWithDeliveryOptions": "GroupCommerceProductItem",
"delivery_types": ["IN_PERSON"]
}
$url = 'https://www.facebook.com/marketplace/106039436102339/electronics/';
$options = [
'http'=> [
'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0',
'protocol' => 1.1,
'header' => [
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Upgrade-Insecure-Requests: 1',
'Host: www.facebook.com',
]
]
];
$context = stream_context_create($options);
$html = file_get_contents($url, false, $context);