Learn, Share, Build

265
October 02, 2017, at 05:18 AM

I have a Scrapy project that need to be build, below the project structure:

.
├── cli.py
├── docs
│   ├── README.md
│   └── README.md.html
├── __init__.py
├── my_scrapy_project
│   ├── exporters.py
│   ├── __init__.py
│   ├── items.py
│   ├── middlewares
│   │   ├── __init__.py
│   │   ├── randomproxy.py
│   │   └── random_user_agent.py
│   ├── middlewares.py
│   ├── pipelines.py
│   ├── settings.py
│   ├── signals.py
│   └── spiders
│       ├── website_extractor_1.py
│       ├── __init__.py
│       └── website_extractor_2.py
├── MANIFEST.in
├── requirements.txt
├── scrapy.cfg
├── setup.py
└── VERSION

Scrapy spiders are executed by cli.py, when I try to build this package it's doesn't inlcude the cli.py, if I put this file cli.py in scripts key in setup.py it doesn't found Scrapy settings when I use get_project_settings

Any help please?

Answer 1

In my setup.py file:

setup(
  ...,
  scripts=['cli.py']
)

And in my cli.py file I define an environnment variable, like this:

os.environ['SCRAPY_SETTINGS_MODULE'] = 'my_scrapy_project.settings'
Rent Charter Buses Company
READ ALSO
Learn, Share, Build

Learn, Share, Build

In Python 3, I would like to check whether value is either string or None

234
Learn, Share, Build

Learn, Share, Build

I'm learning the basics of python and i want to know in this function, how to insert a new line? I know i could have in the function;

269
Learn, Share, Build

Learn, Share, Build

I have an Excel (xlsx) file with 40 or so sheets

269
Learn, Share, Build

Learn, Share, Build

I trying to display the items within a listThis is my code:

202