wersas1/cfscrape 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wersas1/cfscrape

Composer 安装命令:

composer require wersas1/cfscrape

包简介

A PHP module to bypass Cloudflare's anti-bot page.

README 文档

README

Latest Version on Packagist Software License Build Status Total Downloads

A simple PHP module to bypass Cloudflare's anti-bot page (also known as "I'm Under Attack Mode", or IUAM)

Thanks https://github.com/Anorov/cloudflare-scrape

依赖

php >= 7.2

v8js扩展 https://github.com/phpv8/v8js

安装

$ composer require cfscrape/cfscrape

使用

获取响应

$scraper = \Cfscrape\Cfscrape::createScraper();
// 延时
$scraper->setDelay(10);
// 自定义UA
$scraper->setUserAgent('custom-ua');
// \Psr\Http\Message\ResponseInterface
$response = $scraper->get('http://somesite.com');

获取Cookie

// cookies is array
// [
//     'cf_clearance' => 'c8f913c707b818b47aa328d81cab57c349b1eee5-1426733163-3600',
//     '__cfduid' => 'dd8ec03dfdbcb8c2ea63e920f1335c1001426733158'
// ]
[$cookies, $userAgent] = \Cfscrape\Cfscrape::getTokens('http://somesite.com');

// cookies is string
// cf_clearance=c8f913c707b818b47aa328d81cab57c349b1eee5-1426733163-3600; __cfduid=dd8ec03dfdbcb8c2ea63e920f1335c1001426733158
[$cookies, $userAgent] = \Cfscrape\Cfscrape::getCookieString('http://somesite.com');

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固