Comments (7)
That sounds pretty reasonable. I'll take a look.
from colly.
@jodizzle this would be a handy addition. Do you want to work on it?
As a workaround you can add an OnRequest callback with random sleeps:
c.OnRequest(func(_ *colly.Request) {
time.Sleep(time.Duration(rand.Randint(5)+1) * time.Second)
})
from colly.
@asciimoo Ah, I hadn't thought of the OnRequest
approach. Thanks.
And sure, I can try working on it. Do you have any thoughts about what the best implementation would be?
from colly.
I like the idea of extending LimitRule
with a RandomDelay time.Duration
attribute which is 0 by default. If its value isn't 0, a random duration between 0 and RandomDelay
could be added to LimitRule.Delay
on every request. This solution doesn't break the current API and it's intuitive for me. What do you think?
from colly.
Not sure if its okay, but I got interested in the code base so I just implemented the enhancement.
@jodizzle let me know if you still want to fix it and I can decline my pull request.
from colly.
@jlr52 Fine by me -- I was being slow. Your approach seems similar to what I was thinking anyway. I'll take a closer look.
from colly.
implemented in #67 - thanks @jlr52
from colly.
Related Issues (20)
- Fetching data that is not coming in curl output HOT 1
- SIGSEG on local files HOT 1
- Misleading Request.Depth documentation HOT 1
- I have a request that I don't know how to make using Colly. HOT 1
- Different MaxDepth on AllowedDomains and others ? HOT 3
- Is there a way spider for "https://netbanking.hdfcbank.com/netbanking" with my owner account? HOT 1
- HTML encoding is not autodetected properly HOT 6
- request chan error HOT 1
- Cannot send request with no Accept header HOT 1
- handleOnXML tries to parse`.xlsx` files HOT 2
- Next release - When?
- Duplicated requests HOT 1
- How to handle selector not found?
- how to by pass c.OnError HOT 1
- Post Login not persist session
- Weird async behaviour - duplicates in responses HOT 1
- Support BFS search .
- retry redirect to AlreadyVisitedUrl will loop error HOT 1
- Error trying to conditionally set up proxy function HOT 1
- Can't provide duplicate key values when POSTing form data
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 colly.