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

  • SEARCH
  • Home
  • 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 8007177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:44:36+00:00 2026-06-04T17:44:36+00:00

I am using Scrapy to crawl through a website. The links I need to

  • 0

I am using Scrapy to crawl through a website. The links I need to crawl are of the form http://www.somesite.com/details.html?pageId=<some_integer_id>. The value of some_integer_id extends from 1 to 100 (not 100 exactly). What I do is this:

1.I create a function to generate a list of urls:

def generateURLs(self):
    url_list = []
    for i in range(1, 101):
        url_list.append('http://www.somesite.com/details.html?pageId=%d' % i)
    return url_list

2.Use this function to set the value of start_urls of Scrapy like this:

def __init__(self):
    self.start_urls = self.generateURLs()

Is this the recommended way to use Scrapy or is there any other better way to do this when I just need to change a value of a request parameter?

Thanks.

  • 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-06-04T17:44:39+00:00Added an answer on June 4, 2026 at 5:44 pm

    This method sounds fine, there is no “golden” method.

    However, considering Scrapy calls start_requests you could opt for an override of start_requests like:

    def start_requests(self):
        for i in range(1, 101):
            yield Request(url='http://www.somesite.com/details.html?pageId={0}'.format(i), callback=self.my_callback)
    

    Effect is the same, with less code.

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

Sidebar

Related Questions

I'm using Scrapy to crawl a webpage. Some of the information I need only
I am using scrapy tool to scrape content from website, i need help from
I am using scrapy to crawl a website and extract data from it, scrapy
I'm having a problem iterating a crawl using scrapy. I am extracting a title
I'm using Scrapy, in particular Scrapy's CrawlSpider class to scrape web links which contain
I have been using XPath with scrapy to extract text from html tags online,
I am using scrapy to crawl all the web pages under a domain. I
I am using scrapy to crawl different sites, for each site I have an
I'm using scrapy to crawl my sitemap, to check for 404, 302 and 200
I want to know how is the Mozenda Screen Scraper coded? http://www.mozenda.com/screen-scraper I shows

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.