首页›网络›Curl\Browser 浏览器模拟
Curl\Browser 浏览器模拟
Kuoqi\Curl\Browser(56 行):抓取 HTML 并解析为 Document
方法清单
| 方法 | 签名 | 说明 |
|---|---|---|
to | to($url) | 自动随机 UA/Referer/标准头抓取,成功返回 true |
getDocument | getDocument() | 返回解析后的 Document 对象 |
典型用法
$browser = new \Kuoqi\Curl\Browser();
if($browser->to("https://example.com/news")){
$doc = $browser->getDocument();
$title = $doc->evaluate("//h1"); // XPath 取值
}
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI ·
返回首页