{"id":16330074,"url":"https://github.com/rmax/scrapy-inline-requests","last_synced_at":"2025-03-16T14:31:09.806Z","repository":{"id":52704411,"uuid":"3348070","full_name":"rmax/scrapy-inline-requests","owner":"rmax","description":"A decorator to write coroutine-like spider callbacks.","archived":false,"fork":false,"pushed_at":"2022-12-26T20:31:12.000Z","size":70,"stargazers_count":110,"open_issues_count":10,"forks_count":27,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T10:39:29.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmax.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-03T20:36:00.000Z","updated_at":"2024-09-24T17:47:53.000Z","dependencies_parsed_at":"2023-01-31T01:15:46.735Z","dependency_job_id":null,"html_url":"https://github.com/rmax/scrapy-inline-requests","commit_stats":null,"previous_names":["rolando/scrapy-inline-requests"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmax%2Fscrapy-inline-requests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmax%2Fscrapy-inline-requests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmax%2Fscrapy-inline-requests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmax%2Fscrapy-inline-requests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmax","download_url":"https://codeload.github.com/rmax/scrapy-inline-requests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818194,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T23:18:25.259Z","updated_at":"2025-03-16T14:31:09.311Z","avatar_url":"https://github.com/rmax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"======================\nScrapy Inline Requests\n======================\n\n.. image:: https://img.shields.io/pypi/v/scrapy-inline-requests.svg\n        :target: https://pypi.python.org/pypi/scrapy-inline-requests\n\n.. image:: https://img.shields.io/pypi/pyversions/scrapy-inline-requests.svg\n        :target: https://pypi.python.org/pypi/scrapy-inline-requests\n\n.. image:: https://readthedocs.org/projects/scrapy-inline-requests/badge/?version=latest\n        :target: https://readthedocs.org/projects/scrapy-inline-requests/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://img.shields.io/travis/rolando/scrapy-inline-requests.svg\n        :target: https://travis-ci.org/rolando/scrapy-inline-requests\n\n.. image:: https://codecov.io/github/rolando/scrapy-inline-requests/coverage.svg?branch=master\n    :alt: Coverage Status\n    :target: https://codecov.io/github/rolando/scrapy-inline-requests\n\n.. image:: https://landscape.io/github/rolando/scrapy-inline-requests/master/landscape.svg?style=flat\n    :target: https://landscape.io/github/rolando/scrapy-inline-requests/master\n    :alt: Code Quality Status\n\n.. image:: https://requires.io/github/rolando/scrapy-inline-requests/requirements.svg?branch=master\n    :alt: Requirements Status\n    :target: https://requires.io/github/rolando/scrapy-inline-requests/requirements/?branch=master\n\nA decorator for writing coroutine-like spider callbacks.\n\n* Free software: MIT license\n* Documentation: https://scrapy-inline-requests.readthedocs.org.\n* Python versions: 2.7, 3.4+\n\nQuickstart\n----------\n\nThe spider below shows a simple use case of scraping a page and following a few links:\n\n.. code:: python\n\n    from inline_requests import inline_requests\n    from scrapy import Spider, Request\n\n    class MySpider(Spider):\n        name = 'myspider'\n        start_urls = ['http://httpbin.org/html']\n\n        @inline_requests\n        def parse(self, response):\n            urls = [response.url]\n            for i in range(10):\n                next_url = response.urljoin('?page=%d' % i)\n                try:\n                    next_resp = yield Request(next_url)\n                    urls.append(next_resp.url)\n                except Exception:\n                    self.logger.info(\"Failed request %s\", i, exc_info=True)\n\n            yield {'urls': urls}\n\n\nSee the ``examples/`` directory for a more complex spider.\n\n.. warning::\n\n  The generator resumes its execution when a request's response is processed,\n  this means the generator won't be resume after yielding an item or a request\n  with it's own callback.\n\n\nKnown Issues\n------------\n\n* Middlewares can drop or ignore non-200 status responses causing the callback\n  to not continue its execution. This can be overcome by using the flag\n  ``handle_httpstatus_all``. See the `httperror middleware`_ documentation.\n* High concurrency and large responses can cause higher memory usage.\n* This decorator assumes your method have the following signature\n  ``(self, response)``.\n* Wrapped requests may not be able to be serialized by persistent backends.\n* Unless you know what you are doing, the decorated method must be a spider\n  method and return a **generator** instance.\n\n.. _`httperror middleware`: http://doc.scrapy.org/en/latest/topics/spider-middleware.html#scrapy.spidermiddlewares.httperror.HttpErrorMiddleware\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmax%2Fscrapy-inline-requests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmax%2Fscrapy-inline-requests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmax%2Fscrapy-inline-requests/lists"}