2
13 Comments

Help needed in making web scraper

How can I make web scraper to scrape around 1K pages(static) in an hour?
Edit:

May be I asked too broad question so let me try very specific.

  • First of all I know basic scraping thing and I can build scraper so scraping is not an issue here. Main issue is scraping more pages in given interval without being blocked.

  • For example I want to scrap amazon's products page (around 10K- 20K) daily, How should I do?

on November 17, 2019
  1. 1

    For my scraping needs I use python with BeautifulSoup, Postgres and peewee.

    What i do is actually save the raw source file straight to the DB and then run consumer workers to parse and process data (extracting text from images).

  2. 1

    Depending on what you want to scrape it's also something that can be written in a few lines of code in any programming language really. Do you just want to download the page or extract more specific content?

    1. 1

      I want to extract text but since number of requests are large I want to scrap without being blocked and that's what my main concern is.

      1. 2

        It's not that many requests really, depends on who you are scraping but even just rotating user agents is probably fine at this small scale. There are services that give you IPs but they are quite pricy.

        Maybe something like https://github.com/gocolly/colly would work?

        1. 1

          I already tried it and it works for small amount of requests well, but after few days system is able to detect this trick :)

          https://github.com/gocolly/colly looks good. I will try.

          Thanks for suggestion

  3. 1

    Not sure what your use case is, but there's a few scrapers like ScrapingBee by @Daolf.

    1. 1

      Thanks for the mention ! :) Sure ScrapingBee could help you, please let me know your needs and what can I do for you here or by email ;)

      1. 1

        Thanks for interest but I need to scrap around 24k pages per day, so it will be better to build my own scraper instead of using services.

        Can you please tell me how you deal with ip blocking/ which are the best way to get good range of ips and rotate them?

        1. 2

          Hum it really depends if it is 24k pages per day on the same website or not. What concurrency do you need?

          We talk extensively here: https://www.scrapingbee.com/blog/web-scraping-without-getting-blocked about the way to do this without getting blocked, I thing it could help you.

          1. 1

            I want to request 1K - 3K pages of same domain.

            Thanks for sharing article.

            I was looking for something like that specifically Emulate human behaviour i.e: Proxy, Captchas solving and Request pattern section

            1. 1

              If you have time, I don't think you need proxy at all.
              3000 request per day per website equal to 2 requests per minute per website.

              I don't know a website that would have such a low rate limit.

              I guess the cheapest and simplest way to run your thing is to reant a cheap instance on DigitalOcean or Heroku and then launch your scraper everyday, you'll just have to really slow down your request and spreading them evenly across all domain.

              1. 1

                Hey, sorry for delay in response.

                I will definitely look into these.

                Thanks for supporting me this far:)

  4. 1

    This comment was deleted 7 years ago

  5. 1

    This comment was deleted 5 years ago

    1. 1

      Thanks for suggestions