GithubHelp home page GithubHelp logo

Comments (2)

alexhopes avatar alexhopes commented on May 18, 2024 1

Amazing, that really helped. Thank you for being so kind and properly explaining everything!

from advertools.

eliasdabbas avatar eliasdabbas commented on May 18, 2024

Thanks @alexhopes
Glad you liked it!

Yes, since the function uses only the HEAD method, it is extremely fast, and therefore sends many requests to the server. You would typically get a 429 "too many requests" status code, asking you to slow down the requests. This does not mean that there is anything wrong with the page.

  • Retries: the crawler already runs retries for each URL by default, and this can be modified using the custom_settings parameter.

  • Concurrent requests: If you are getting a 429 error, you can slow down your crawling by also using custom_settings.

You can use any combination of the following custom settings to manage your crawling speed as needed:

import advertools as adv

adv.crawl_headers(URL_LIST, "output_file.jl",
    custom_settings={
        "RETRY_TIMES": 10,  # defaults to 2
        "CONCURRENT_REQUESTS": 1,  # defaults to 16
        "CONCURRENT_REQUESTS_PER_DOMAIN": 1,  # defaults to 8
        "DOWNLOAD_DELAY": 0.75,  # defaults to 0 
}

There are also some SEO crawling scripts and recipes that you might be interested in. Also, check out Scrapy's settings for more details on what each of them means.

Hope that helps.

from advertools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.