Deployment of the scrapy project in Linux

Source: Internet
Author: User

First, you need to install scrapy in Linux. If Python 2.4 is installed in Linux, you need to install python on your own, the built-in python is used, so does it meet our requirements for python? No. The Python that comes with the system lacks Python-Dev, then installs the setuptool tool, and uses easy_install-u scrapy to install scrapy. If you have other requirements, you can install it on your own. After using scrapy on your machine to develop a project, you must note that after uploading the project to the server, you must configure the environment variable to add the current project to the executable environment variable, there are several ways to add environment variables, such as writing a bash/shell script and using export. It can also be used as a pythonProgramMember, directly add it to the setting file

 Import  OS
Import Time
Import Sys
SYS. Path. append ( ' % S ' % OS. getcwd ())
Bot_name = ' Crawl '
Bot_version = ' 1.0 '

Spider_modules = [ ' Crawl. Spiders ' ]
Newspider_module = ' Crawl. Spiders '
Default_item_class = ' Crawl. Items. crawlitem '
User_agent = ' % S/% s ' % (Bot_name, bot_version)

Item_pipelines = [ ' Crawl. Pipelines. crawlpipeline ' ]
Depth_limit = 5

Download_delay = 3

Log_level = ' Error '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.