Comments (13)
还有一个注意的是
$ql = QueryList::getInstance();
之后
记得不要用静态方法来调用例如:$ql::html($html) 否则内存爆了还是会出错
都得改成 $ql->html($html)
from querylist.
隔20秒左右就会出现一次,每次ID不同
from querylist.
有人可以解疑吗?
from querylist.
我也遇到一样的情况,不知道问题是什么产生的,每次执行完都销毁了
from querylist.
我需要一份能重现这个错误的代码来做分析,可以加QueryList交流群,然后私发给我
from querylist.
我知道怎么解决了,应该是因为循环调用静态的QueryList,但是每次调用的静态get方法都会创建新的phpQuery对象,导致积压在内存中,内存爆了,就存不了新爬到的内容。
(destruct方法不能回收对象资源,只能去掉不必要的旧html缓存,这个问题应该需要解决一下,毕竟querylist全都是静态方法,会常驻内存,但是每次调用的phpQuery却又是重新创建一个。)
解决方法,只初始化一个$ql = QueryList::getInstance();
,后面就一直用这个对象,刚刚爬了几百个页面都没事,之前爬50个页面就爆了。 @jae-jae @windpursuer
from querylist.
你这才是正确用法,看看QueryList官方文档给出的例子:
from querylist.
@jae-jae 或许把这个报错列出来提示新手遇到怎么解决会比较好,因为刚开始用也是糊里糊涂
from querylist.
我做一个专题
from querylist.
@mountainguan 感谢,就是你说的那种情况,我从数据库里取出待爬url列表后就不停循环创建新对象来抓取详情页,然后就爆掉了。@jae-jae 辛苦大神
from querylist.
没有办法解决
from querylist.
手册上的根本没用
from querylist.
rules 不是rule
from querylist.
Related Issues (20)
- 切片后数据为空
- Add support laravel 9 HOT 5
- 啥时候能支持laravel9 HOT 1
- Fatal error: Uncaught TypeError: Argument 1 passed to QL\Services\MultiRequestService::QL\Services\{closure}() must be an instance of GuzzleHttp\Exception\RequestException, instance of GuzzleHttp\Exception\ConnectException given HOT 3
- 希望支持一下laravel9&&php8+ HOT 4
- 期望实现devtools-protocol,就能和puppeteer一样愉快的使用了 HOT 1
- 依赖库 pguardiario/phpuri 已被删除
- PHP7.4环境代码执行结果与预期不一致! HOT 3
- 使用【Baidu 插件】返回 百度安全验证 网络不给力,请稍后重试 返回首页 问题反馈 HOT 1
- 希望支持php8.0/laravel 9 HOT 2
- The domain querylist.cc is expired,please fix it
- 什么时候支持php8啊,已经在用8.2了,马上都出8.3了 HOT 4
- php8.1 fixes - Cannot push my branch
- QueryList4.2.8列表采集,不能正常执行 HOT 1
- 能否兼容 guzzlehttp/guzzle 升级 HOT 1
- 突然提示 Package tightenco/collect is abandoned, 能否升级一下呢? HOT 1
- thinkphp8框架 HOT 6
- 难道你们都没有这个致命错误? HOT 6
- 为什么经常有这种错误 HOT 2
- 版本依赖有问题 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from querylist.