Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 889061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:30:26+00:00 2026-05-15T13:30:26+00:00

I am new to python and scrapy and hence am getting some basic doubts(please

  • 0

I am new to python and scrapy and hence am getting some basic doubts(please spare my ignorance about some fundamentals,which i m willing to learn :D).

Right now I am writing some spiders and implementing them using scrapy-ctl.py from the command line by typing:

C:\Python26\dmoz>python scrapy-ctl.py crawl spider

But I do not want two separate python codes and a command line to implement this.I want to somehow define a spider and make it crawl urls by writing and running a single python code.I could notice that in the file scrapy-ctl.py, ‘execute’ of type function is imported,but i am clueless as to how this function can be defined in the code containing spider.Could someone explain me how to do this, if it is possible because it greatly reduces the work.

Thanks in advance!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:30:27+00:00Added an answer on May 15, 2026 at 1:30 pm

    But I do not want two separate python codes and a command line to implement this. I want to somehow define a spider and make it crawl urls by writing and running a single python code.

    I’m not sure the effort pays out, if you just want to scrape something. You have at least two options:

    • Dig into scrapy/cmdline.py. You’ll see that this is a kind of dispatch script, finally handing over the work to the run method for the specified command, here crawl (in scrapy/commands/crawl.py). Look at line 54, I think scrapymanager.start() will begin your actual command, after some setup.

    • A little hacky method: use pythons subprocess module to have one your project and execution in one file (or project).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 494k
  • Answers 494k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Can you use awk? As pointed out by wilhelmtell and… May 16, 2026 at 11:07 am
  • Editorial Team
    Editorial Team added an answer Here is one approach: private List<Control> m_lstControlsToValidate; private void SetupControlsToValidate()… May 16, 2026 at 11:07 am
  • Editorial Team
    Editorial Team added an answer Have you check the DB connection. May 16, 2026 at 11:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm new to this site, and new to Python. So I'm learning about Regular
I'm relatively new to Python and am having problems programming with Scapy, the Python
I am fairly new to Python programming, and completely new to cross-platform GUI building
I'm new to python and django, and when following the Django Book I learned
I am new to Python - be forewarned! I have a template class that
I'm new to Python and I have been trying to search through html with
I'm still relatively new to Python, so if this is an obvious question, I
I'm new to Ruby (experienced with Python, C++ and C). I need to create
I'm new in Django and Python and I'm stuck! It's complicated to explain but
I'm new to subprocess module of python, currently my implementation is not multi processed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.