Giter Club home page Giter Club logo

Comments (6)

Akkisdiary avatar Akkisdiary commented on June 2, 2024 1

Can you please show the code for def _crawler_Stop() ? And also my imagePipeline and deltafetch middleware are also not working??

from crochet.

this-is-r-gaurav avatar this-is-r-gaurav commented on June 2, 2024

Solved The Issue Thanks i was passing Crawlrunner object as Parameter, as the function stop. The Object gets destroyed. This leads to Stop Iteration Error I guess

from crochet.

MarwaKH29 avatar MarwaKH29 commented on June 2, 2024

Hi, i have the same error occuring when i run a spider within a flask app but i don't get a response from the spider
i am using flask, crochet(1.12.0), scrapyd, twisted(19.10.0)

from crochet.

HimavarshaVS avatar HimavarshaVS commented on June 2, 2024

Solved The Issue Thanks i was passing Crawlrunner object as Parameter, as the function stop. The Object gets destroyed. This leads to Stop Iteration Error I guess

I am using the same method and facing same issue.
how did you resolve it. any help would be great

from crochet.

dzhen19 avatar dzhen19 commented on June 2, 2024

Hello my brother I have the same issue.

from crochet.

this-is-r-gaurav avatar this-is-r-gaurav commented on June 2, 2024

The Reactor Code look like this, which call upon GeneralSpider which fetches all the necessary data based on the pk as primary key.

runner = CrawlerRunner()
output = []
@run_in_reactor
def scraped_by_id(pk):
    global runner
    dispatcher.connect(_crawler_result, signal=signals.item_scraped)
    eventual = runner.crawl(GeneralSpider, id=pk)
    dispatcher.connect(_crawler_Stop, signals.engine_stopped)
    return eventual


def _crawler_result(item, response, spider):
    global output_data
    output_data.append(dict(item))


def _crawler_Stop():
    # Perform any operation which is relevant to your application, like notify user
    pass

And my GeneralSpider class look like this. Where Job contains info like url to scrape, fields to scrape, etc.

class GeneralSpider(scrapy.Spider):
    def __init__(self, id, **kwargs):
        self.id = id
        self.custom_settings = {"LOG_LEVEL": "DEBUG"}

        job = Job.objects.get(pk=id)

Hope this helps @MarwaKH29 @HimavarshaVS @dzhen19

from crochet.

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.